Find many Mac upgrades on the web in PHP steps, but all too complex, and there are all kinds of problems
Write down my easiest way to upgrade
Mac with php5.6 version, to upgrade to php7.2 steps below 1, download homebrew
Https://brew.sh/index_zh-cn
2. Brew Installation PHP
Enter the following in the terminal, do not specify the PHP version installed, will automatically upgrade to the latest version, and Brew will automatically update
Brew Install PHP
3, modify Apache
After downloading PHP, the terminal inside actually will prompt you to change how to do, completely does not need to follow the network other steps to be so complex
1, open Spotlight, into the/etc/apache2/httpd.conf
Add the two lines of terminal hint, red box callout
2, to your Apache default directory/library/webserver/documents below to add a info.php file
<?php
phpinfo ();
? >
3, start Apache
sudo apachectl start
Http://localhost/info.php Open
When you see this page, it means you're successful.