|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50626 Oddly date related error message
Submitted: 2010-01-01 18:58 UTC Modified: 2010-01-01 22:44 UTC
From: sworddragon2 at aol dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.3.1 OS: Windows XP Professional SP3
Private report: No CVE-ID: None
 [2010-01-01 18:58 UTC] sworddragon2 at aol dot com
I have a script, that got sometimes a date - related error message but nowhere is such a function called. I don't got the errors myself, I see them just in my error log from other users.

Maybe this is not a bug, but i'm searching for a few days for a solution and have no explanation why this bug at line 26 after a flush(); appears (line 26 is marked as a comment in "Actual result:"). The error don't appear at the most time. This is very randomly.

Reproduce code:
	header('Expires: Tue, 19 Jan 2038 03:14:07');
	header('Last-Modified: Thu, 01 Jan 1970 00:00:00');
	header('Cache-Control: public');
		if(isset($_GET['mime_type']) && ($_GET['mime_type']==='image/bmp' || $_GET['mime_type']==='image/gif' || $_GET['mime_type']==='image/jpeg' || $_GET['mime_type']==='image/png' || $_GET['mime_type']==='text/css' || $_GET['mime_type']==='text/html'))
	header('Content-type: '.$mime_type.'; charset=utf-8');
		echo fread($file,$global['server_configuration']['output_buffer']);
		}//This is line 26
		echo fread($file,$size);

Actual result:
Warning: main(): 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/Paris' for '1.0/no DST' instead in E:\Programme\Lokaler Server\Apache Software Foundation\Apache2.2\htdocs\tower-defense\core\global\includes\load_content.php on line 26

If needed I can post the declared variables at the moment the error appears or other related scripts.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-01 21:36 UTC]
Do you have the "date.timezone" setting actually set in php.ini (phpinfo() output will tell you).
 [2010-01-01 21:45 UTC] sworddragon2 at aol dot com
The date.timezone setting is not set but this is no necessary because no related date functions are called.

I can use date_default_timezone_set('UTC') as exmaple in my load_content.php but this would just be a workaround. There must be a reason why a date related error message appears after a flush(); while no date related funtions are used.
 [2010-01-01 21:56 UTC]
You *need* to make that setting. Internally PHP can also use date related functions that require a proper date.timezone of being set. You can debug this with a C-level debugger and setting a breakpoint at guess_timezone and get a backtrace.
 [2010-01-01 22:44 UTC] sworddragon2 at aol dot com
Maybe this should be written as a Note in the documentation that PHP can internally call date related functions.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Jun 06 02:03:40 2023 UTC