nginx支持php的解析配置,php
user www-data;(注意此用戶,若是註釋掉,錯誤日誌裏面會出現鏈接php5-fpm失敗,權限拒絕)html
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;
}
nginx