Bug #62660 [Fbk->NoF]: PHP error logging with FPM fails to display an IP address and correct time
| From: | php-bugs at lists dot php dot net | Date: | Sun, 16 Apr 2023 04:22:08 +0000 |
| Subject: | Bug #62660 [Fbk->NoF]: PHP error logging with FPM fails to display an IP address and correct time | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-244209@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62660&edit=1
ID: 62660
Updated by: php-bugs@lists.php.net
Reported by: joe at cirkuit dot net
Summary: PHP error logging with FPM fails to display an IP
address and correct time
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: FPM related
Operating System: FreeBSD 8.1
PHP Version: 5.3.15
Assigned To: bukka
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2023-04-07 13:40:54] bukka@php.net
Apology for taking so long to look into this. My time was limited which changed a year ago when I
got some funding on FPM maintance from the PHP Foundation so I'm trying to resolve all the
issues as part of that. I'm writing this as sort of an assurance that it will be looked at if
the feedback is provided as there is some feedback required.
I have just tried various configuration and I'm not able to re-create this. There are lots of
variations how the logs can be configured. We have got FPM error_log and access.log. Then there is
PHP error_log (defined in php.ini) and then there is of course Apache ErrorLog that except other
things get FCGI error messages (only if PHP ini error_log is not set) and also logs its own stuff.
And finally there is Apache CustomLog.
Unless I missed anything, the IP on PHP side is logged only by access.log (depending on format) and
on the Apache side the CustomLog (depending on format) shows IP and ErrorLog also shows IP for
FastCGI error messages . I assume that fcgi error messages is what is reported here, right? If so,
then I don't think there is anything we can do about this as this is handled by Apache. Also
when testing on Linux I was not able to recreate this as it always shows IP for me in Apace error
log.
To be able to investigate this more I would need detailed info about the configuration for all above
mentioned logs and more detailed info how to recreate this. I will mark this as awaiting the
feedback. This bug tracker might eventually become read only so please create a GitHub issue in such
case. Thanks.
------------------------------------------------------------------------
[2019-08-28 16:22:23] joe at manvscode dot com
YES!!!!!!!!!!! 7 YEARS LATER
------------------------------------------------------------------------
[2017-04-12 18:14:08] bukka@php.net
Is this still an issue?
If so I'm not sure if this has anything to do with FPM as you point to the Apache error log
unless you set FPM error_log to that location? Please could you post your fpm config?
------------------------------------------------------------------------
[2012-07-25 14:40:28] joe at cirkuit dot net
Description:
------------
This only happens under a specific condition. If the error_log file being written
to is world readable/writable (didn't test other cases), then any php
errors/warnings/notices that are logged have no IP address and have a UTC
timestamp.
Changing permissions from 777 to 644 resolves this issue.
I know the error log should probably never be world writable, but it's strange how
strengthening the permissions caused the IP and correct timestamp log correctly.
Test script:
---------------
chmod 777 /usr/local/apache/logs/error_log
[create any php script that produces an error or notice]
[run the php script via www (using fastcgi, not sure if this matters)]
tail /usr/local/apache/logs/error_log
fixed when:
chmod 644 /usr/local/apache/logs/error_log
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62660&edit=1