Mac 使用homebrew搭建 PHP 运行环境

Homebrew是一款超级好用的包管理工具,可以实现快速搭建各种开发环境。

1、如果没有安装brew,复制以下命令,ENTER

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

2、安装Mysql

brew install mysql

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

3、安装Nginx

brew install nginx

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

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

brew install php-[version]

配置文件:`/usr/local/etc/php/`
启动PHP-FPM:`sudo php-fpm -D`
停止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`
联系我们

邮箱 626512443@qq.com
电话 18611320371(微信)
QQ群 235681453

Copyright © 2015-2024

备案号:京ICP备15003423号-3