Php – How to use the correct PHP version? phpinfo says another version

fedorahttpdPHP

Fedora 17. I have a PHP version installed on my system, let name it as phpMain.

And I've compiled another PHP version from source using this option:

./configure –prefix=/opt/php/5.x.y

I will call it as phpAlt.

Then I went to the /usr/bin folder and rename the php to phpMain and created a symlink on /usr/bin/ pointing to /opt/php/5.x.y/bin/php.

When I type in the terminal:

php -v

I got the phpAlt version, and its ok.
But running a phpinfo project in the brownser I get the wrong version, the phpMain version.

What I need to change for the phpinfo shows the correct phpAlt version?

Best Answer

For the command line:
Adjust your search path ($PATH environment variable) so the directory containing phpAlt is before the one containing phpMain.

For the webserver: (assuming you use PHP as an Apache module)
Remove the LoadModule line for the system PHP, and add one pointing at the .so for `phpAlt.

Related Topic