Mac 使用homebrew启动PHP环境命令

Homebrew是一款超级好用的包管理工具,可以实现快速搭建各种开发环境。
1、如果没有安装brew,可以执行一下命令进行安装。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2、安装Nginx

brew install nginx

配置文件:/usr/local/etc/nginx/
启动:brew services start nginx
停止:brew services stop nginx
重启:brew services restart nginx

3、安装PHP([version]代版本,如56)

brew install php-[version]

配置文件:/usr/local/etc/php/
启动PHP-FPM:sudo php-fpm -D  或者  brew services start php72(php版本号)
停止PHP-FPM:sudo kill -INT cat /usr/local/var/run/php-fpm.pid
重启PHP-FPM:sudo kill -USR2 cat /usr/local/var/run/php-fpm.pid

4、安装Mysql

brew install mysql

配置文件:/usr/local/etc/my.cnf
启动:brew services start mysql
停止:brew services stop mysql
重启:brew services restart mysql


 

你可能感兴趣的:(Mac)