How to install php on Apple computers: 1. Open the terminal and add the source; 2. Execute the [brew search php] command to view the php version; 3. Execute the [brew install php version] command to install php.
First open [terminal], execute the command [brew tap exolnet/homebrew-deprecated], and add the source operation;
(recommended tutorial : php graphic tutorial)
Note: The adding source operation may fail due to network reasons, just try a few more times.
Then execute the command [brew search php] to query all versions of php;
(Video tutorial recommendation: php video tutorial)
Finally execute the command [brew install specify version name] to install php5.6;
If there are multiple For different versions of php, you can switch the php version through the following commands.
brew unlink php56 brew link php71
The above is the detailed content of How to install php on Apple computer. For more information, please follow other related articles on the PHP Chinese website!