Linux · 2015年12月25日 0

Lnmp平台Nginx返回 PHP文件报File not found

在搭建Lnmp平台时,做Nginx整合php是打算用phpinfo查看php是否配置正确。结果坑爹了

 

vim /etc/nginx/conf.d/default.conf

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
php

 

phpinfo文件内容

<?php
phpinfo();
?>