When Apache is connected to multiple PHP, how to switch multiple PHP versions?

Source: Internet
Author: User
Tags phpinfo

PHP has a problem connecting multiple PHP in Apache, how to switch multiple PHP version? My machine has a apache2.2.22, but there are two php,5.3.10 and 5.4.3,5.3.10 are Mac OS X, there are some configuration is not what I want, so I want to switch to 5.4.3 above, but there seems to be only one libphp5.so file. Ask a friend, friend said, modify this libphp5.so can solve, is this? Add Comment sharing1 Approval objection, will not show your nameWjj, development engineer1 People agreeI also have a number of local versions, my local PHP is installed in the OSX system using homebrew, I have two versions:
php5.4 and php5.6
My default version before is php5.4, if you want to migrate from Shell and Apache to php5.6 at the same time:

1. First you need to install php5.6 through brew, very simple:

Brew Install PHP56

(Of course, you have to unlink out your old version of php5.4 first)

2. After installing the php5.6, you will find that the PHP version of the local shell has been change, but Apache default phpinfo print out the version is still php5.4, to view your Apache configuration file, my local is:

/etc/apache2/http.conf

There will be support for the path of the libphp5.so, and here I am:

Libexec/apache2/libphp5.so

The actual location of this directory is:

/usr/libexec/apache2/libphp5.so

When you install php56 through brew, a new version of libphp5.so has been generated, here:

/usr/local/cellar/php56/5.6.17/libexec/apache2/libphp5.so

And I directly renamed the original libphp5.so, created a soft chain to/usr/local/cellar/php56/5.6.17/libexec/apache2/libphp5.so just fine:-)

Now restart Apache, refresh the phpinfo look, I believe you must switch to the new version.

When Apache is connected to multiple PHP, how to switch multiple PHP versions?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.