标签:nginx php 配置
nginx支持php的解析配置,
user www-data;(注意此用户,如果注释掉,错误日志里面会出现连接php5-fpm失败,权限拒绝)
location ~ \.php$ {
root html;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;(此处要加上$document_root,否则找不到php文件)
include fastcgi_params;
}
本文出自 “我爱CTO” 博客,请务必保留此出处http://tanjunjie.blog.51cto.com/6988/1579630
标签:nginx php 配置
原文地址:http://tanjunjie.blog.51cto.com/6988/1579630