Nginx PHP 返回200,但是空白页
来源:互联网 发布:美联储加息概率数据 编辑:程序博客网 时间:2024/05/22 09:33
ngxin;php-fpm安装后,html静态页面没问题,但是phpinfo页面虽然返回200,但总是空白页
也没有任何报错,考虑应该是nginx已经将php页面转移给php处理了,所以问题应该在php的配置上,经过查找,发现需要在nginx中加入一句话
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
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就可以显示出页面了。
也没有任何报错,考虑应该是nginx已经将php页面转移给php处理了,所以问题应该在php的配置上,经过查找,发现需要在nginx中加入一句话
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
安装完nginx后默认的fastcgi_params配置文件中没有上面这句话。
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就可以显示出页面了。
- Nginx PHP 返回200,但是空白页
- nginx下运行php的程序时返回200访问却是空白页问题的解决方法
- nginx下运行php的程序时返回200访问却是空白页问题的解决方法
- nginx php空白页 fastcgi_param
- tomcat 请求返回空白页
- php 加密后空白页
- ajax请求失败但是返回200
- 当访问php遇到空白页时
- PHP返回内容过长时被nginx截断的解决办法
- PHP返回数据被nginx截断问题的解决方法
- PHP代码错误,nginx直接返回500错误解决方案
- Nginx 访问php文件返回404 Not Found错误
- 记录一次解决PHP返回数据被nginx截断的问题
- ajax 请求返回200 但是不进success--2
- ajax 请求返回200 但是不进success--2
- 做了个安卓和php端通信的app,但是返回数据处理时异常
- codeigniter 在nginx中首页空白页的问题解决
- php的安装完成后为什么显示空白页?
- 3. struts上传:Action
- 所谓自己的路
- AndroidManifest.xml file missing 解决方案
- W5100E01-AVR是什么?怎么用?(三)(用户手册V1.0版)
- pl/sql基本语句
- Nginx PHP 返回200,但是空白页
- OnClick、OnClientClick、OnServerClick之间的关系
- iphone 获取设备型号 设备系统
- java集合总结
- CALayer 详解
- 4. struts上传:Action struts-config.xml
- 常用排序算法递归篇之归并排序
- 5. struts上传:Action web.xml
- oracle基本语句