Home > Article > Backend Development > How to install php environment on macbook
How to install the php environment on macbook: first install brew; then install php7.1 through the command "brew install php@7.1"; then install mysql5.7 and nginx; finally start PHP through the start command.
Recommendation: "PHP Video Tutorial"
mac installation php environment
Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install php7.1
brew install php@7.1
Install mysql5.7
brew install mysql@5.7
Install nginx
brew install nginx
Start nginx
brew services start nginx
Start PHP
brew services start php@7.1
Start mysql
brew services start mysql@5.7 /usr/local/opt/mysql@5.7/bin/mysql.server start
php some paths
/usr/local/opt/php@7.1/bin/php /usr/local/Cellar/php@7.1/7.1.28/bin/phpize
php-fpm configuration file (php running user changes user and group here)
/usr/local/Cellar/php@7.1/7.1.28/.bottle/etc/php/7.1/php-fpm.d/www.conf php.ini /usr/local/etc/php/7.1/php.ini nginx.conf /usr/local/etc/nginx/nginx.conf my.cnf /usr/local/etc/my.cnf
The above is the detailed content of How to install php environment on macbook. For more information, please follow other related articles on the PHP Chinese website!