I got this error when I requested to update the PHP version from 5.2.17 to PHP 5.3.21 on the server.
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: 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 'America/New_York' for 'EDT/-4.0/DST' instead</p> <p>Filename: libraries/Log.php</p> <p>Line Number: 86</p> </div> Warning: 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 'America/New_York' for 'EDT/-4.0/DST' instead in /filelocation right here/system/libraries/Log.php on line 86 Warning: 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 'America/New_York' for 'EDT/-4.0/DST' instead in /filelocation right here/system/libraries/Log.php on line 99 <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: 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 'America/New_York' for 'EDT/-4.0/DST' instead</p> <p>Filename: libraries/Log.php</p> <p>Line Number: 99</p> </div>
You probably need to put the timezone in a configuration line in your php.ini
file. You should have a block like this in your php.ini file:
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = America/New_York
If not, add it (replacing the timezone by yours). After configuring, make sure to restart httpd (service httpd restart
).
Here is the list of supported timezones.
If you cannot modify your php.ini configuration, you could as well use the following snippet at the beginning of your code:
date_default_timezone_set('Africa/Lagos');//or change to whatever timezone you want
The list of timezones can be found at http://www.php.net/manual/en/timezones.php.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With