PHP version?

PHP version?

Posted by: pcw
Posted on: 2007-02-14 04:21:00

I've recently changed to PHP version 5 in the panel but from the shell when I execute the command "php -v" the version says:

[clamato]$ php -v
PHP 4.4.4 (cgi) (built: Nov 7 2006 13:14:18)

What is up with that?

Re: PHP version?

Posted by: Raz2133
Posted on: 2007-02-14 04:27:00

In reply to:

What is up with that?


You can configure the PHP version used by a particular hosted domain, but only the php4 executable is in the default shell path, so that is the executable that will be used by default.

You can access PHP5 from the shell, but you will have to supply the full path to the executable.

/usr/local/php5/bin/php -v


Mark

Re: PHP version?

Posted by: Tor
Posted on: 2007-02-14 04:32:00

http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_troubleshooting&Number=59835

4 and 5 are on the server. Only 4 is in your shell path. You can add 5 to your path if you want.


tor.eff.orgEdited by Tor on 02/14/07 04:36 AM (server time).

Re: PHP version?

Posted by: Raz2133
Posted on: 2007-02-14 04:39:00

In reply to:

4 and 5 are on the server. Only 4 is in your shell path.


Thanks for the extra info Tor, I have modified my post above.

Mark

Re: PHP version?

Posted by: pcw
Posted on: 2007-02-14 04:39:00

Ah alright thanks.
Do I need to add it to my path for it to work? I thought that was done at the panel when choosing PHP 5.

Re: PHP version?

Posted by: Raz2133
Posted on: 2007-02-14 04:43:00

In reply to:

Do I need to add it to my path for it to work? I thought that was done at the panel when choosing PHP 5.


If you configured the domain for PHP5, then it will work fine for PHP code run from your domain as CGI. It is just when running PHP5 from the shell that you will need to provide the full path.

If you wish to see what PHP version is active for a particular domain, create a file called (for example) test.php containing the following line;

<?php phpinfo(); ?>

Browsing to this file will show the PHP version in use for the domain, and lots of other 'stuff. wink

Mark

Tags: php versionphp 4shell