nginx index.php报404的错误
nginxindex.html 静态页面是正常的,动态页面index.php报404的错误nginx.conf中fastcgi的配置,fastcgi_param 下面两种都不可
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_indexindex.php;
#fastcgi_paramSCRIPT_FILENAME/scripts$fastcgi_script_name;
fastcgi_paramSCRIPT_FILENAME$fastcgi_script_name;
include fastcgi_params;
}
在nginx 的html目录下添加了index.php
<?php
phpinfo();
?>
php-fpm已经起来了,
$ ps -aux | grep php-fpm
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 129490.00.1247683156 ? Ss 10:24 0:00 php-fpm: master process (/opt/php/etc/php-fpm.conf)
yyt 129500.00.1247682592 ? S 10:24 0:00 php-fpm: pool www
yyt 129510.00.1247683300 ? S 10:24 0:00 php-fpm: pool www
php.ini把cgi.fix_pathinfo改为1
cgi.fix_pathinfo=1
ps -aux|grep php ,只看到php-fpm 进程,没有看到php-cgi的进程
谢谢了! re,期待大神出现 fastcgi_paramSCRIPT_FILENAME$fastcgi_script_name;
这一行要带路径!
比如最常用的是:/var/www/html$fastcgi_script_name; 回复 3# lsstarboy
恩,谢谢,解决了
页:
[1]