How to install the php development environment on mac? This article mainly shares with you examples of how to install the PHP development environment on Mac. I hope it can help you.
Install xcode:
Search and download xcode from the App Store and install it automatically.
Install homebrew:
Go to the official website brew.sh, get the latest download address, and paste it into the terminal. You need to have xcode first.
Install mysql:
Use homebrew to install, only one command is needed, brew install mysql.
apache:
ios has a built-in apche server, and the service can be started directly. Open the terminal, switch to the root user, sudo -i.
Start command sudo apchectl start
Close command sudo apchectl stop
Restart command sudo apchectl restart
View version command httpd -v
apache default root directory/Library/WebServer/Documents
Command:
1. Switch user
Switch taiwu user to root user: sudo -i
Switch root user back to taiwu user: su - taiwu
2.
Query Use brew to install applications: brew list
Query brew that can be installed: brew search php56
Use brew to install php56:
brew install homebrew /php/php56 --with-mssql --with-homebrew-openssl --with-homebrew-libxslt --with-homebrew-curl --with-fpm --with-debug --with-gmp --with-imap --with-tidy --with-libmysql
brew install homebrew/php/php53 --with-mssql --with-homebrew-openssl --with-homebrew-libxslt --with-homebrew -curl --with-fpm --with-debug --with-gmp --with-imap --with-tidy --with-libmysql
After brew installs php56, read the instructions:
php configuration file Address: /usr/local/etc/php/5.6/php.ini
Modify the configuration file php-fpm.conf
Modify the listening port to 127.0.0.1:9056
daemonize = yse
sudo ./php56-fpm start
Related recommendations:
Mac installation PHP7 full tutorial
Detailed explanation of php version switching examples on mac
The above is the detailed content of Example sharing of how to install php development environment on mac. For more information, please follow other related articles on the PHP Chinese website!