php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73999 php-fpm worker always output uncaught exception to stderr
Submitted: 2017-01-26 04:16 UTC Modified: 2018-09-23 13:34 UTC
From: chrisl at cnyes dot com Assigned: bukka (profile)
Status: Not a bug Package: FPM related
PHP Version: 7.0.15 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
9 + 34 = ?
Subscribe to this entry?

 
 [2017-01-26 04:16 UTC] chrisl at cnyes dot com
Description:
------------
Looks like php7-fpm worker always output uncaught exception to stderr, event catch_workers_output = yes.

so my nginx error log always has php exception logs.

Test script:
---------------
[www]
listen = 127.0.0.1:4000
listen.backlog = 128

listen.owner = www-data
listen.group = www-data
listen.mode = 0660
listen.allowed_clients = 127.0.0.1

user = www-data
group = www-data

pm = dynamic
pm.max_children = 5
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 5
pm.max_requests = 100

pm.status_path = /status
ping.path = /ping

request_terminate_timeout = 40s
catch_workers_output = yes

chdir = /

env[HOSTNAME] = $HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

Expected result:
----------------
when catch_workers_output = yes, it should only log error with the php-fpm error log file, and stderr should be empty.

Actual result:
--------------
php7-fpm worker always output uncaught exception to stderr, event catch_workers_output = yes.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-10 19:07 UTC] bukka@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bukka
 [2018-09-23 13:34 UTC] bukka@php.net
-Status: Assigned +Status: Not a bug
 [2018-09-23 13:34 UTC] bukka@php.net
I finally got time to look into this one - sorry for the late replay.

This is actually not a bug as it's an intended behaviour. The catch_workers_output is meant to pipe the output of the worker (child process) to the master process and the master process will output it to either stderr (if running if foreground) or to error log file (if demonized).

The fact that the error can be also seen in nginx error log is because error is also send to FCGI_STDERR. To disable it, fastcgi.logging can be set to off in php.ini.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC