With PHP 5.4 adding warnings to alert of timezone issues, this error is quite common:
Warning: strtotime(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in somefile.php on line 42
Okay, fair enough. Adding date_default_timezone_set('UTC')
is nice and simple, but I don't want to have to do this for every single script, especially when doing stuff on CLI.
So I added a line to my php.ini file:
date.timezone=UTC
And... it doesn't work. The warning still appears.
For debugging, I did this:
echo file_get_contents(php_ini_loaded_file());
And it outputs:
extension=./ext/php_gd2.dll extension=./ext/php_oauth.dll extension=./ext/php_curl.dll date.timezone=UTC
The extension
lines all work - I take them out and I can't use those functions, I put them in and I can. It's just date.timezone
that's not taking. What am I doing wrong?