web建站教程
     
  1. 首页
  2. 前端UI组件库
  3. AI项目和框架
  4. AIGC工具
  5. 百度echarts
  6. 地图大全
  7. 前端知识
  8. 更多
    vuejs
    js入门
    php入门
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站
    AI应用

Nginx配置什么原因导致php错误不提示

936 ℃

哪些Nginx配置会导致php错误不提示,下面web建站小编给大家简单介绍一下具体解决方法!

正确配置方法:

server {
  # server settings
  ...
   
  # server block location rules
  ...
  
  # php-fpm status check
  location ~ ^/(status|ping)$ {
    access_log off;
    # php-fpm settings
    fastcgi_param PHP_VALUE "error_reporting=E_ALL";
    include fastcgi_params;
    fastcgi_pass unix:/run/php/php7.4-fpm.sock;
  }
  
  # php error logs
  location ~ \.php$ {
    fastcgi_param PHP_VALUE "error_log=/var/log/nginx/php_error.log";
    include fastcgi_params;
    fastcgi_pass unix:/run/php/php7.4-fpm.sock;
  }
  
  # error pages
  error_page 404 /404.html;
  error_page 500 502 503 504 /50x.html;
  
  # static files
  location ~* \.(jpg|jpeg|gif|png|css|js|ico)$ {
    expires 7d;
    access_log off;
  }
  
  # disable direct access to .ht files
  location ~ /\.ht {
    deny all;
  }
}

PS:错误输出地址:/var/log/nginx/php_error.log

Nginx设置301定向跳转,重定跳到新的URL链接

宝塔Nginx配置只允许指定网址访问接口

php代码出现的5个常见出错及原因

如何利用nginx配置和PM2实现VPS服务器的反向代理?

Nginx如何配置HTTP请求的内容过滤和防火墙

标签: nginx配置 php错误

上面是“Nginx配置什么原因导致php错误不提示”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_3991.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 首页 > php入门
Trae:新一代免费的AI编程工具

呱呱工具箱

一款免费的在线小工具,无需下载,打开即可使用!呱呱工具箱

在线育儿补贴计算器

快来看看你到底可以领到多少补贴!生活小工具
上一篇:
下一篇:
x 打工人ai神器