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

使用php fpm+;时无法获取错误堆栈跟踪或错误日志;nginx,nginx,php,php-5.5,Nginx,Php,Php 5.5,我在我的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-

我在我的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;
    }
error_log = /tmp/php5-fpm.log
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-FPM配置:

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;
    }
error_log = /tmp/php5-fpm.log
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-FPM池配置:

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;
    }
error_log = /tmp/php5-fpm.log
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

提前感谢。

在您的配置中,is表示
错误日志
文件位于
/etc/…
中,但是您可能只是在错误的位置查找

您是否检查了默认的错误日志位置?通常应该是:
/var/log/nginx/*
-其中有一个
nginx\u错误.log
文件。可能还有其他日志文件

还请注意,PHP-FPM和config配置在语法上有所不同。 检查你是否有这样的错误。它可能被错误地解析,从而导致错误


检查错误日志的文件权限。nginx的运行用户能够在那里写吗?

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

sudo apt-get install php5-xdebug
它应该安装模块配置,但之后可能必须重新启动php fpm

sudo service php5-fpm restart
一旦安装了它,我最终可以从php5 fpm获得堆栈跟踪