gpt4 book ai didi

nginx - 使用 php-fpm + nginx 时无法获取错误堆栈跟踪或错误日志

转载 作者:行者123 更新时间:2023-12-01 23:54:42 24 4
gpt4 key购买 nike

我在我的 Ubuntu 14.04 机器上使用 php-fpm 5.5.9 和 nginx 1.4.6。我已经使用 apt-get 包管理器安装了它们。我无法获得我的 index.php 脚本在错误日志和浏览器中遇到的错误的堆栈跟踪。我从 stackoverflow 和其他文章中搜索并实现了几个解决方案,但没有一个对我有用。这是我的 nginx conf 以及我的 php-fpm conf 文件。如果我犯了任何愚蠢的错误,请帮助我。

Nginx 配置:

location ~ \.php$ {
# With php5-fpm:
#try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
fastcgi_pass 127.0.0.1:7777;
fastcgi_index index.php;
}

PHP-FPM 配置:

error_log = /tmp/php5-fpm.log

PHP-FPM 池配置:

catch_workers_output = yes 
slowlog = /var/log/php-fpm/$pool.log.slow
listen = 127.0.0.1:7777

php_flag[display_errors] = On
php_admin_value[error_log] = /tmp/fpm-php.www.log
php_admin_flag[log_errors] = On

提前致谢。

最佳答案

如果不使用 PHP xdebug 模块,老实说找不到合理的解决方案。

sudo apt-get install php5-xdebug

它应该安装模块配置,但之后可能需要重新启动 php-fpm。

sudo service php5-fpm restart

安装完成后,我终于可以从 php5-fpm 中获取堆栈跟踪信息。

关于nginx - 使用 php-fpm + nginx 时无法获取错误堆栈跟踪或错误日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24635345/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com