WebFaction
Community site: login faq

I'm setting up a PHP application that requires PHP 5.3+ so I set up a PHP5.3 app in the panel(web228). Installation involves executing a script via command line. When I ran the script, I kept getting an error with no obvious reason and happened to run php -v to get a precise version for a bug report.

Except that PHP reports itself as:

PHP 5.2.17 (cli) (built: Jun 20 2012 10:49:36)

…which isn't even an available option for me to create an application(not that I want it).

If I enter php53 -v I get:

PHP 5.3.27 (cli) (built: Jul 30 2013 07:54:02)

…which is what I expected the first time around. Is this actually correct?

asked 29 Aug '13, 17:25

Su Generis
2527
accept rate: 0%

edited 29 Aug '13, 17:25


This is correct.

We have PHP 5.2, PHP 5.3, and PHP 5.4 installed, and the shell's executable search path (the PATH environment variable) doesn't know which version of PHP you've used in installing an application from the Control Panel -- that information lives in the Shared Apache webserver's configuration file.

As a result, you'll need to use the correct php executable when interacting with your code:

PHP 5.2: /usr/local/bin/php
PHP 5.3: /usr/local/bin/php53
PHP 5.4: /usr/local/bin/php54

And, since /usr/local/bin is on the PATH by default, you can use "php", "php53", and "php54" on the command line to execute the appropriate version.

Hope that helps!

permanent link

answered 29 Aug '13, 23:39

ryans ♦♦
5.0k93460
accept rate: 43%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×21
×5

question asked: 29 Aug '13, 17:25

question was seen: 3,444 times

last updated: 29 Aug '13, 23:39

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM