php.net |  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
Votes:6
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel at produktion203 dot se
New email:
PHP Version: OS:

 

 [2012-11-18 20:46 UTC] daniel at produktion203 dot se
Description:
------------
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_pass   127.0.0.1:9000;
                        fastcgi_index  index.php;
                        fastcgi_param  SCRIPT_FILENAME  /home/www/xxxxxxx.xx$fastcgi_script_name;
                        include        fastcgi_params;
                }


Using this pool-configuration:
[xx-xx-widget]

listen = 127.0.0.1:9000

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:
----------------
/var/log/php-error.log:
PHP Warning:  file_get_contents(/usr/home/www/xxxxxxx.xxx/assets/img/widget/button_large_red.png): failed to open stream: No such file or directory in /usr/home/www/xxxxxxx.xx/button.php on line 67

Actual result:
--------------
/var/log/nginx-error.log:
2012/11/18 21:27:03 [error] 82087#0: *146061423 FastCGI sent in stderr: "PHP message: PHP Warning:  file_get_contents(/usr/home/www/xxxxxxx.xxx/assets/img/widget/button_large_red.png): 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: xxx.xxx.xxx.xxx, server: widget.xxxxxxx.xx, request: "GET /blogcounter/image?http://xxxxxxxx.blogspot.com/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "widget.xxxxxxx.xx", referrer: "http://xxxxxx.blogspot.xxxx/"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-10 19:00 UTC] bukka@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bukka
 [2023-05-13 21:51 UTC] bukka@php.net
-Status: Assigned +Status: Not a bug
 [2023-05-13 21:51 UTC] bukka@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC