Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
You have to restart the webserver for it to pick up the changes. I'm not sure if you did that, but it isn't listed in your steps. – Alex Aug 28 '12 at 19:45
I tried sudo service httpd stop && sudo service httpd start too. – GarouDan Aug 28 '12 at 19:53

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.

share|improve this answer
I had installed php and httpd using yum normally. I had search on /etc/php.ini and /etc/httpd/conf/httpd.conf and didn't seen no LoadModule php? Where is it? Or, how to put it? – GarouDan Aug 28 '12 at 19:35
@GarouDan On Fedora you'll find it at /etc/httpd/conf.d/php.conf. – Michael Hampton Aug 28 '12 at 19:39
Lol, looks almost. But I tried tree | grep "\.so" on the compiled directory /opt/php/php-5.x.y and no results (tree | grep "\.php" return results). – GarouDan Aug 28 '12 at 19:48
Should I pass the entire paht (/opt/php/php-5.x.y/bin/php) instead LoadModule php5_module modules/ and LoadModule php5_module modules/ How should I put at /etc/httpd/conf.d/php.conf? – GarouDan Aug 28 '12 at 19:52
@GarouDan Please refer to the PHP manual -- If built in accordance with their instructions following the steps they outline will work. (If not, rebuild in accordance with the manual.) – voretaq7 Aug 28 '12 at 19:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.