|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49623 PHP shows deprecation warning BEFORE compressed body
Submitted: 2009-09-22 13:32 UTC Modified: 2009-09-22 22:05 UTC
From: 3 at 14 dot by Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.3.0 OS: 2.6.28-15-generic #49-Ubuntu SMP
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: 3 at 14 dot by
New email:
PHP Version: OS:


 [2009-09-22 13:32 UTC] 3 at 14 dot by
I have set Error_Reporting(0) both in the script & in the php.ini.
I have an PHPBB forum (3.0.6) with zlib compression turned on.

Most of the warnings are gone, but in some cases (when some data is sent via POST), I am still getting a Notice "<b>date(): It is not safe to rely on the system's timezone settings.", and it is printed BEFORE compressed page body, so that browser reports broken encoding. 

After disabling zlib compression browser started to show notice and page content. After setting date.timezone in php.ini Notice is gone.

Reproduce code:
Install PHPBB 3.0.6: turn zlib compression = on, make sure to unset date.timezone in php.ini. Then try to reply to a private message.

Expected result:
No notices on the screen, no "broken encoding"

Actual result:
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 22 Sep 2009 13:09:15 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Expires: 0
Last-Modified: Tue, 22 Sep 2009 13:09:15 GMT
Cache-Control: private, no-cache="set-cookie"
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 3181

<b>[phpBB Debug] PHP Notice</b>: in file <b>/includes/functions_messenger.php</b> on line <b>390</b>: <b>date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSD/4.0/DST' instead</b><br />
.Cv_...%{.)..%i.S#.E...d....>....9.t,..w./.............3..o../H..O.....u._9...N..;....^[fSw..{.T:.V<[.t.<yb.....s..."h2.............h8j6.1.. ........2.,.-.H.C...hv.]d2 AD3...n|.:v.;........[here goes the rest of the compressed page]


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-22 16:11 UTC] 3 at 14 dot by
 [2009-09-22 16:18 UTC]
Thank you for your bug report.

That PHP shows a warning even though error reporting is disabled sounds like bug #49362, "Deprecated php.ini options warnings output even with display_errors=off".
 [2009-09-22 20:34 UTC]
That's quite expected and unfixable.
 [2009-09-22 22:05 UTC] 3 at 14 dot by
Is it possible at least to show a warning in the compressed part, not before so that browsers would behave much nicer? 

It is really confusing, and if one have no idea how to sniff HTTP traffic, it might eat huge amount of time to figure out the cause.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 23 04:01:29 2024 UTC