PHP version?

software development

#1

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?


#2

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


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#3

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.org


#4

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

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#5

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.


#6

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


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)