Mac PHP Version switching

Source: Internet
Author: User

Mac OS comes with PHP versions, but many extensions are not.

This site: http://php-osx.liip.ch/provides almost all of the PHP versions

By entering

Curl-s http://php-osx.liip.ch/install.sh | Bash-s 5.6

  

You can install the latest installation package for 5.6 and include most of the extension libraries.

After installation, a php5-xxx directory will be added under/usr/local/and found in this directory entropy-php.conf

LoadModule php5_module/usr/local/php5/libphp5.so

  

Copy this line of code and find it in the/etc/apache2/httpd.conf

LoadModule Php5_module libexec/apache2/libphp5.so

  

Annotate it and add the address you copied above, as follows.

#LoadModule Php5_module Libexec/apache2/libphp5.soloadmodule php5_module/usr/local/php5/libphp5.so

 

Restart Apache apachectl Restart after saving

Apache2 PHP version of the switch, if you want to php-v also use the latest version of the operation.

VI ~/. profile//There is no edit, just create a new this file name.

Input

Export Path=/usr/local/php5/bin:/usr/local/php5/sbin: $PATH

  

Clear the cache so that it takes effect

SOURCE ~/. Profile

And then Php-v is already the latest version.

Mac PHP Version switching

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.