Mac comes with version php5.6. Since php7 brings many new features and performance improvements, we decided to upgrade php7
Enter the following command to install php7. 1. Installation package. During the installation process, you need to enter the system password
curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
Open the terminal and enter php -v. Why is it still prompted that the version is php5.6?
php-osx will not overwrite the original version. Instead, two PHP versions are installed. The root directory of the new version of PHP7.1 is /usr/local/php5, and the startup script path is /usr/local/php5/bin/php.
You can open the terminal, Temporarily adjust the system variable path by the following method (it will become invalid immediately after closing the terminal)
export PATH=/usr/local/php5/bin:$PATH
You can also permanently modify it by adding php7 to the environment variable by the following method
sudo vim ~/.bash_profile
Write in the file
#export PHP PATH This is a comment, you can delete it
export PATH=/usr/local/php5/bin:$PATH
Finally, run the following command
source ~/.bash_profile
After the installation is completed, php -m, you will find that even xdebug and Zend OPcache are also Installed together
The above is the detailed content of MacOS upgrade comes with PHP5.6 and upgrade to PHP7.1. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version
God-level code editing software (SublimeText3)

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.