Update your own PHP version to 5.6 or 7.0 under Mac

Source: Internet
Author: User

The PHP version that comes with OS X 10.11 is php 5.5.x, what if we want to update the PHP version to 5.6 or 7.0?

Download and install PHP 5.6

Open the terminal and run the following command:

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

The version of PHP 5.6 will then be installed in the following path:

/usr/local/php5/
Download and install PHP 7.0

Open the terminal and run the following command:

-s http://php-osx.liip.ch/install.sh | bash -s 7.0

After you enter, you will see a warning under EI Capitan:

10.11. As this is quite new, there may be issues still. Your mileage may vary.

Do not worry about this warning, wait for the download installation is complete.

Configuration path

Installation complete If you run the PHP-V command in the terminal, the old version of the Mac comes with it. Therefore, we also need to configure the path.
Enter the following command on the command line:

sudo vim ~/.bash_profile

Then, at the end of the file, add:

export PATH=/usr/local/php5-7.0.7-20160526-160257/bin:$PATH;

Note: I am configuring the path of the installed PHP7.0, you need to go to/usr/local to see the path of the PHP you have installed.
Finally, run the command:

source ~/.bash_profile

Configuration is complete, try again php-v display is the latest installed PHP version.

Update your own PHP version to 5.6 or 7.0 under Mac

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.