|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79070 PHP suddenly stops logging errors until Apache2 is restarted
Submitted: 2020-01-06 12:07 UTC Modified: 2020-01-19 11:06 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: solusvm at web dot de Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 7.4.1 OS: Debian 10.2
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.
Block user comment
Status: Assign to:
Bug Type:
From: solusvm at web dot de
New email:
PHP Version: OS:


 [2020-01-06 12:07 UTC] solusvm at web dot de
I'm using PHP 7.4.1 with Apache2 (libapache2-mod-php7.4, Version: 7.4.1-1+0~20191218.8+debian10~1.gbp21c50e) on my Debian 10.2 system and I'm facing an issue since about December 23. Because I upgraded from PHP 7.4.0 to 7.4.1 on December 19 and I never experienced this issue before, I guess this issue/bug is related to PHP 7.4.1 or the corresponding Apache2 PHP module.

The logging works fine but after a few days it suddenly stops to log PHP errors, warnings etc. in my "error.log" file. Apache2 logging still works, but just the PHP errors aren't logged anymore. I'm also getting no error or exception when calling the "error_log" function manually and I can't find anything in other logs that could explain this.

When I restart the Apache2 server (and thus also the PHP module), the logging starts working but after a few days it'll stop logging PHP errors again.

I have these modules installed: bz2, cli, common, curl, gd, intl, json, mbstring, mysql, opcache, readline, soap, xml, xsl, zip, geoip and I changed nothing in the last months. I just upgraded from PHP 7.4.0 to 7.4.1 on December 19 and then this issue started to happen. So it looks like it could be the new PHP version but I need the logging to work without suddenly stopping...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-18 02:03 UTC] solusvm at web dot de
Now I noticed that this issue appears when I edit the Apache2 log file when the webserver is running. But it's only caused by editing the file using sed or vim in my case. When I use nano, I can edit it and Apache2 will still append new lines to it.

Where is the difference between editing with sed/vim and nano? I use sed for quite a long time now to remove certain lines from my Apache2 logs and I'm quite sure that I never faced this issue before about December 19...
 [2020-01-18 02:26 UTC] bugreports at gmail dot com
> Where is the difference between editing with sed/vim and nano? 

pretty sure by write directly in the file or atomic new file->rename
see "tail -f" versus "tail -F"

the webserver happily still logs in his open handle which got in the meantime deleted and after restart the webserver it's thrown away because the last process (the webserver) is closing it and at start it just opens the new file you created in the meantime

that's how filehandles are working on Unix
 [2020-01-18 19:22 UTC] solusvm at web dot de
Thank you very much for the explanation, that will definitely be the reason. I hadn't thought of that.
 [2020-01-18 19:24 UTC] solusvm at web dot de
-Status: Open +Status: Closed
 [2020-01-18 19:24 UTC] solusvm at web dot de
I closed this report because I have the answer now and it's neither a bug nor related to PHP, thanks!
 [2020-01-19 11:06 UTC]
-Status: Closed +Status: Not a bug
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 18:01:29 2024 UTC