macOS 安装 nginx
brew install nginx cp nginx.conf.default nginx.conf cd www.conf.default www.conf
安装PHP 参考:
https://javascript.net.cn/articles/582
找到PHP的位置
/usr/local/php7
修改 ~/profile
PATH="/usr/local/php7/bin:/usr/local/php7/sbin:$PATH"
开启
php-fpm
关闭 php-fpm
sudo killall php-fpm
如果遇到上传文件权限不够
nginx open() client_body_temp failed Permission denied
修改 nginx.conf 中 user root root 不可以,需要改成 user root owner;
然后 sudo nginx 启动正常。
设置 nginx 开机启动
复制 /usr/local/Cellar/nginx/1.17.0/homebrew.mxcl.nginx.plist 到 /Library/LaunchDaemons
cp /usr/local/Cellar/nginx/1.17.0/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/homebrew.mxcl.nginx.plist sudo chown root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
最后 brew uninstall httpd LOL
修改时间 2022-10-12
声明:本站所有文章和图片,如无特殊说明,均为原创发布。商业转载请联系作者获得授权,非商业转载请注明出处。