带有专用错误日志文件的PHP-FPM [英] PHP-FPM with dedicated error log file

查看:76
本文介绍了带有专用错误日志文件的PHP-FPM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个Apache2/PHP-FPM站点,希望将PHP-FPM的错误记录到其自己的错误日志文件中.但是,在当前配置下,错误将以以下格式记录到/var/log/php5-fpm.log中:

I've set up an Apache2/PHP-FPM site and would like PHP-FPM's errors to be logged to its own error log file. However, with the current configuration, the errors are being logged to /var/log/php5-fpm.log in the following format:

WARNING: [pool www] child 22926 said into stderr: "NOTICE: PHP message: PHP Parse error:  syntax error, unexpected 'if' (T_IF) in /var/www/site.com/error.php on line 1"

在我的/etc/php5/fpm/pool.d/www.conf中,我有以下选择:

In my /etc/php5/fpm/pool.d/www.conf I have the following options:

php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
catch_workers_output = yes

当我禁用catch_workers_output时,错误记录将完全停止.但是,在phpinfo()输出中,它显示了我在配置中指定的日志文件.

When I disable catch_workers_output, the error logging ceases completely. However, in phpinfo() output, it is showing the logfile I specify in the configuration.

为什么PHP5-FPM不遵守此日志文件.对于在单独文件中记录的fpm池,是否有任何错误的方法?

Why is PHP5-FPM not respecting this logfile. Is there any way to have errors for the fpm pool logged in a separate file?

我的php版本:

# php5-fpm  -v
PHP 5.4.9-4~precise+1 (fpm-fcgi) (built: Nov 30 2012 10:48:01)

感谢您提供任何信息!

推荐答案

您将在主FPM配置中找到error_log =/var/log/php-fpm.log.根据您的示例,您正在池"配置中设置此设置,该配置仅适用于该特定池/域.

You'll find the error_log = /var/log/php-fpm.log in your main FPM Configuration. Based on your example you are setting this in a Pool configuration, which will only work for that specific pool/domain.

这篇关于带有专用错误日志文件的PHP-FPM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆