php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77106 Missing separator between PHP messages
Submitted: 2018-11-04 21:08 UTC Modified: 2022-11-29 21:56 UTC
Votes:6
Avg. Score:3.3 ± 1.8
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:4 (80.0%)
From: olafvdspek at gmail dot com Assigned: bukka (profile)
Status: Closed Package: FPM related
PHP Version: 8.0.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: olafvdspek at gmail dot com
New email:
PHP Version: OS:

 

 [2018-11-04 21:08 UTC] olafvdspek at gmail dot com
Description:
------------
A newlines seems to be missing between the messages.

Test script:
---------------
echo 1 / 0;
echo 1 / 0;

Expected result:
----------------
2018-11-04 19:00:23: (mod_fastcgi.c.2520) FastCGI-stderr: PHP message: PHP Warning:  Division by zero in /var/www/test.php on line 2
2018-11-04 19:00:23: (mod_fastcgi.c.2520) FastCGI-stderr: PHP message: PHP Warning:  Division by zero in /var/www/test.php on line 3

Actual result:
--------------
2018-11-04 22:05:35: (mod_fastcgi.c.2520) FastCGI-stderr: PHP message: PHP Warning:  Division by zero in /var/www/test.php on line 2PHP message: PHP Warning:  Division by zero in /var/www/test.php on line 3

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-05 10:57 UTC] sjon at hortensius dot net
this must be a mod_fastcgi specific issue, because the cli works fine, see https://3v4l.org/PNWne
 [2018-12-07 08:16 UTC] olafvdspek at gmail dot com
Maybe related to https://bugs.php.net/bug.php?id=69031
 [2019-02-09 12:05 UTC] olafvdspek at gmail dot com
Somebody?
 [2019-12-15 14:00 UTC] olafvdspek at gmail dot com
Anybody?
 [2020-11-13 12:39 UTC] olafvdspek at gmail dot com
-Package: *General Issues +Package: FPM related -PHP Version: 7.3.0RC4 +PHP Version: 7.4.12
 [2020-11-13 12:39 UTC] olafvdspek at gmail dot com
-
 [2020-11-13 15:46 UTC] olafvdspek at gmail dot com
Does the syslog filter also apply to fpm stderr?
 [2020-11-15 09:14 UTC] olafvdspek at gmail dot com
The syslog filter escapes characters and I don't see any escaped newlines, so that's not it IMO.
 [2020-11-17 08:35 UTC] olafvdspek at gmail dot com
-PHP Version: 7.4.12 +PHP Version: 8.0.0RC3
 [2020-11-17 08:35 UTC] olafvdspek at gmail dot com
-
 [2020-12-01 08:23 UTC] olafvdspek at gmail dot com
-PHP Version: 8.0.0RC3 +PHP Version: 8.0.0
 [2020-12-01 08:23 UTC] olafvdspek at gmail dot com
-
 [2021-02-23 14:18 UTC] olafvdspek at gmail dot com
-PHP Version: 8.0.0 +PHP Version: 8.0.2
 [2021-02-23 14:18 UTC] olafvdspek at gmail dot com
Somebody? ;)
 [2021-03-21 19:16 UTC] bukka@php.net
-Assigned To: +Assigned To: bukka
 [2021-03-21 19:16 UTC] bukka@php.net
Yeah this is FPM / internal error logging issue related to log collection in master process. Basically it's using a pipe from child to process its output. If the child send 2 messages that don't end with a new line at the same time, then it's a single event and master process cannot do anything about that. We might need to introduce some tweak in the child to maybe explicitly add a new line for such cases (internal PHP errors).
 [2022-11-29 21:56 UTC] bukka@php.net
-Summary: Missing newlines between PHP messages +Summary: Missing separator between PHP messages
 [2022-11-29 21:56 UTC] bukka@php.net
I had a proper look into this and it is not possible to separate the messages as requested with a new line and separate entries. The reason is that the message is actually FastCGI error data (error stream). It means that server will display it always as a single entry (I tried with nginx as well as Apache httpd) for each request due to the way how FastCGI works. It means it should stay as a single line without any new line character.

That said I agree that not having any separator doesn't look very nice and it's not readable so I went for separating the messages with '; ' which I think look much better. As it kind of impacts logging message format and it's somewhere between feature and bug fix, I will target only PHP 8.2.
 [2022-11-29 21:58 UTC] bukka@php.net
The following pull request has been associated:

Patch Name: Fix bug #77106: Missing separator in FPM FastCGI errors
On GitHub:  https://github.com/php/php-src/pull/10022
Patch:      https://github.com/php/php-src/pull/10022.patch
 [2022-12-21 12:01 UTC] git@php.net
Automatic comment on behalf of bukka
Revision: https://github.com/php/php-src/commit/891b58d50305d194dd711d2ada3f2f8d5e6cfae2
Log: Fix bug #77106: Missing separator in FPM FastCGI errors
 [2022-12-21 12:01 UTC] git@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC