php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53593 phpinfo() triggers system timezone warning
Submitted: 2010-12-22 04:57 UTC Modified: 2010-12-22 11:02 UTC
From: anthon dot pang at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.4 OS: Ubuntu 10.04
Private report: No CVE-ID: None
 [2010-12-22 04:57 UTC] anthon dot pang at gmail dot com
Description:
------------
phpinfo() should not output raw warning because:

1) it is redundant; the table already states: Default timezone America/New_York

2) phpinfo() is not a date/time function, even if it uses one internally; http://php.net/manual/en/function.date-default-timezone-set.php

3) the warning is emitted between rows of an HTML table, resulting in invalid markup

Propose either suppressing the warning, or pretty printing it, so it doesn't break the layout.


Test script:
---------------
<?php phpinfo();

Actual result:
--------------
date

Warning: phpinfo() [function.phpinfo]: 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 'America/New_York' for 'EST/-5.0/no DST' instead in /path_to_script/phpinfo.php on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-22 11:02 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-12-22 11:02 UTC] pajoye@php.net
You have to set a correct timezone in your php.ini, doing it will kill this warning.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC