之前没有在意一直都是在Apache下部署,换成Nginx折腾了半天。终于搞定。
server {
listen 80;
server_name **
location / {
root /www/;
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php { #去掉后面的$
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$; #增加这一句
fastcgi_param PATH_INFO $fastcgi_path_info; #还有这一句
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
Mac下修改完上述之后就可以正常访问了
查询资料说需要修改php.ini 配置, 中将 cgi.fix_pathinfo=0 改为1 但是Mac下我并没有去修改就搞定了
nginx 1.6.2 和上面的稍有不同。
<