哪些Nginx配置会导致php错误不提示,下面编程教程网小编给大家简单介绍一下具体解决方法!
正确配置方法:
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配置什么原因导致php错误不提示”的全面内容,想了解更多关于 php入门 内容,请继续关注编程基础学习网。
沃梦达教程
本文标题为:Nginx配置什么原因导致php错误不提示
基础教程推荐
猜你喜欢
- 设定php简写功能的方法 2023-03-17
- PHP+MySQL+sphinx+scws实现全文检索功能详解 2023-01-31
- PHP判断一个字符串是否是回文字符串的方法 2024-01-31
- php实现构建排除当前元素的乘积数组方法 2022-11-23
- php实现数组筛选奇数和偶数示例 2024-02-05
- Yii框架连表查询操作示例 2023-02-13
- PHP手机短信验证码实现流程详解 2022-10-18
- PHP实现抽奖系统的示例代码 2023-06-26
- PHP实现文件下载【实例分享】 2024-04-27
- php数组函数序列之array_sum() – 计算数组元素值之和 2024-01-15
