php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34385 phpinfo throws a strict standards warning on timezone
Submitted: 2005-09-06 05:41 UTC Modified: 2005-09-06 12:45 UTC
From: david at tulloh dot id dot au Assigned: derick (profile)
Status: Not a bug Package: Date/time related
PHP Version: 5.1.0RC1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
23 + 36 = ?
Subscribe to this entry?

 
 [2005-09-06 05:41 UTC] david at tulloh dot id dot au
Description:
------------
phpinfo throws a E_STRICT error.  This is caused by PHP  guessing at the timezone.  I'm not sure that the error message belongs in the middle of the phpinfo output.

Reproduce code:
---------------
php -a -n

<?php
error_reporting(E_STRICT);
phpinfo(INFO_MODULES);
?>

Expected result:
----------------
phpinfo() should not throw errors, E_STRICT included.

Actual result:
--------------
(CLI output, similar results through apache module)
...

date

date/time support => enabled

Strict Standards: phpinfo() [/phpmanual/function.phpinfo.html]: It is not safe to rely on the systems timezone settings, please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We use 'America/New_York' for 'EST' instead. in /home/lod/Downloads/php-5.1.0RC1/- on line 2
Default timezone => America/New_York

...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-06 08:06 UTC] derick@php.net
Assigning to me, but not sure if we're going to change that. In your case it is actually good that it did this, as it shows that it incorrectly guessed "America/New_York", which uses the same abbreviation (EST) as Eastern Australia. So fix your setting :)
 [2005-09-06 09:56 UTC] sniper@php.net
Where does it say phpinfo() can't throw errors? Nowhere, fix your setttings.

 [2005-09-06 12:45 UTC] david at tulloh dot id dot au
It seemed a bit odd to me that a function, used properly would throw an error.

As for fixing the setting, you may have noticed that the reproduce code included the -n flag, the setting is correctly set in my php.ini.  However the setting is 'incorrect' in the default setup; it's also not documented in the supplied -recomended or -dist files.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 22:01:31 2024 UTC