0

I was trying to upgrade from php 5.3 to php 5.5.x on my CentOS 5.5 vps running nginx.

I ran yum upgrade php command.

When I run php -V from command line, I get this output:

[root@ns1 ~]# php -v
**PHP 5.5.1** (cli) (built: Jul 24 2013 18:16:31)

However when I run a test_page.php with this code, it says php 5.3.14

<?php
phpinfo();
?>

Can someone tell me what I did wrong, because both are supposed to show same version isn't it?

To be sure, I also want to find if there are multiple installations of php, but I don't know how to do it, that's why I am posting this question here.

Thanks in advance for your help.

1 Answer 1

0

You can try doing this from the Command line:

php -i | grep "ENV\[\"_\""

Should look like this

_ENV["_"] => /usr/bin/php

Then run test_page.php and Look for that ENV[""] block. If the two are different, then your web server is pointing to a different PHP then the default from the command line.

If your Distro supports it, you can try to locate any PHP instances

locate php | grep -E "\/php$"

Sample output

/usr/bin/php
/usr/include/php
/usr/lib/php
/usr/share/php

And you can gather I only have /usr/bin/php but you can review your list to see which are actually PHP binaries

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .