您好,欢迎访问一九零五行业门户网

Nginx PHP 返回200,但是空白页_PHP教程

ngxin;php-fpm安装后,html静态页面没问题,但是phpinfo页面虽然返回200,但总是空白页
也没有任何报错,考虑应该是nginx已经将php页面转移给php处理了,所以问题应该在php的配置上,经过查找,发现需要在nginx中加入一句话
fastcgi_param  script_filename $document_root$fastcgi_script_name;
安装完nginx后默认的fastcgi_params配置文件中没有上面这句话。
在nginx.conf中的
        location ~ .php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            #fastcgi_param  script_filename  /scripts$fastcgi_script_name;
            fastcgi_param  script_filename $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
或者在fastcgi_params配置文件中加入
# php only, required if php was built with --enable-force-cgi-redirect
fastcgi_param  redirect_status    200;
fastcgi_param  script_filename $document_root$fastcgi_script_name;
然后重启nginx就可以显示出页面了。
http://www.bkjia.com/phpjc/371851.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/371851.htmltecharticlengxin;php-fpm安装后,html静态页面没问题,但是phpinfo页面虽然返回200,但总是空白页 也没有任何报错,考虑应该是nginx已经将php页面转移给...
其它类似信息

推荐信息