系统: os x yosemite 10.10.1
系统自带php和php-fpm
路径备注:
php.ini : /etc/
php-fpm.conf :/etc/
立即学习“PHP免费学习笔记(深入)”;
nginx.conf :/usr/local/etc/nginx/nginx.conf
nginx 默认root:/usr/local/opt/nginx/html
1.安装nginx,我使用了brew
brew install nginx
2.启动php-fpm
sudo php-fpm
3.打开nginx.conf
开启php的注释,配置好自己的root
location ~ \.php$ { root /Users/maming/php; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
注意
SCRIPT_FILENAME /script$fastcgi_script_name;
要改成
SCRIPT_FILENAME $document_root$fastcgi_script_name;
4.开启nginx
sudo nginx
或重启
sudo nginx -s reload
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号