OS X 使用 Homebrew 重新安装 php 5.6

1
brew reinstall --with-fpm php56

安装完后按提示操作

1
2
3
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist

确认端口是否已经使用

1
netstat -antl | grep 9000

启用 php-fpm

1
2
3
4
5
6
7
## pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

配置参数说明