大网数据广告活动
服务器运维问答

directive 'catch_workers_output = yes' don't work as I want

· 52CE 我爱测

I have CentOS 7 with apache 2.4.35 with pmp event and php-fpm all works fine but all php errors are go to one big file for all my virtual hosts. I read all docs about it and find that catch_workers_output = yes might be help me. …

问题原文

原帖链接 · progreccor · CC BY-SA 4.0

I have CentOS 7 with apache 2.4.35 with pmp event and php-fpm

all works fine but all php errors are go to one big file for all my virtual hosts.

I read all docs about it and find that

catch_workers_output = yes

might be help me. I think that this directive send all php errors to apache log file but there is no luck.

I don't really know what I should now.

here is my php.conf

<Proxy "unix:/var/run/php-fpm/default.sock|fcgi://php-fpm">
 # we must declare a parameter in here (doesn't matter which) or it'll not register the proxy ahead of time
 ProxySet disablereuse=off
</Proxy>
# Redirect to the proxy
<FilesMatch \.php$>
    SetHandler proxy:fcgi://php-fpm
</FilesMatch>

#
# Allow php to handle Multiviews
#
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

ProxyErrorOverride on

p.s. I think that individual pool per site will solve the problem but I think that it get really more memory, because every pool need to create empty slots to start serving...

已采纳解答

原帖链接 · progreccor · CC BY-SA 4.0

I found that if I comment out this line in file /etc/php-fpm.d/www.conf

php_admin_value[error_log] = /var/log/php-fpm/www-error.log

like here:

;php_admin_value[error_log] = /var/log/php-fpm/www-error.log

all php errors go to the apache log files (individual per site)

There is no need to touch catch_workers_output . Leave it commented out!

;catch_workers_output = no

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-10-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。