0

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?

2
  • 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. Commented Aug 28, 2012 at 19:45
  • I tried sudo service httpd stop && sudo service httpd start too. Commented Aug 28, 2012 at 19:53

1 Answer 1

1

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.

8
  • 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? Commented Aug 28, 2012 at 19:35
  • 1
    @GarouDan On Fedora you'll find it at /etc/httpd/conf.d/php.conf. Commented Aug 28, 2012 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). Commented Aug 28, 2012 at 19:48
  • Should I pass the entire paht (/opt/php/php-5.x.y/bin/php) instead LoadModule php5_module modules/libphp5.so and LoadModule php5_module modules/libphp5-zts.so? How should I put at /etc/httpd/conf.d/php.conf? Commented Aug 28, 2012 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.) Commented Aug 28, 2012 at 19:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.