|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63555 errors outputed to stderr instead of logfile using fastcgi
Submitted: 2012-11-18 20:46 UTC Modified: 2023-05-13 21:51 UTC
Avg. Score:3.8 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: daniel at produktion203 dot se Assigned: bukka (profile)
Status: Not a bug Package: FPM related
PHP Version: 5.4.8 OS: FreeBSD 9.0-RELEASE
Private report: No CVE-ID: None
 [2012-11-18 20:46 UTC] daniel at produktion203 dot se
PHP.ini values:
error_reporting = E_ALL & ~E_NOTICE
log_errors = On
display_errors = Off
error_log = /var/log/php-error.log

Nginx fastcgi config:
location ~ \.php$ {
                        fastcgi_index  index.php;
                        fastcgi_param  SCRIPT_FILENAME  /home/www/xxxxxxx.xx$fastcgi_script_name;
                        include        fastcgi_params;

Using this pool-configuration:

listen =

user = xx-xx
group = xx-xx

pm = static
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35

pm.status_path = /fpm-status.php

php_admin_value[open_basedir] = /var/tmp:/home/www/apc:/home/www/xxxxxxxx.xx

Expected result:
PHP Warning:  file_get_contents(/usr/home/www/ failed to open stream: No such file or directory in /usr/home/www/xxxxxxx.xx/button.php on line 67

Actual result:
2012/11/18 21:27:03 [error] 82087#0: *146061423 FastCGI sent in stderr: "PHP message: PHP Warning:  file_get_contents(/usr/home/www/ failed to open stream: No such file or directory in /usr/home/www/xxxxxxx.xx/button.php on line 67" while reading response header from upstream, client:, server: widget.xxxxxxx.xx, request: "GET /blogcounter/image? HTTP/1.1", upstream: "fastcgi://", host: "widget.xxxxxxx.xx", referrer: "http://xxxxxx.blogspot.xxxx/"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-10 19:00 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bukka
 [2023-05-13 21:51 UTC]
-Status: Assigned +Status: Not a bug
 [2023-05-13 21:51 UTC]
Apology for very late reply. There were very limited resources in FPM maintenance which changed around a year ago with PHP Foundation funding. There is however a big backlog of issues so got to this just now.

I have done some debugging and it is most likely because it was not possible to open /var/log/php-error.log by child process. It means this log file needs to be writable by the child. If it's not, it falls back to fcgi error as can be seen here. I just tested the same configuration when the file is writable is it works as expected. I also tested the case when it's not writable and it was falling back to fcgi logging like here.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Jun 08 22:03:38 2023 UTC