Jump to content

Warning: date() [function.date]: It is not safe to rely on the system's timezone


Recommended Posts

So I set the date.timezone in php.ini and restarted the server but I still get this warning:

 

Warning: date() [function.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

 

This is what I set it to date.timezone = "America/New_York"

Then you didn't set it in the right place. Are you sure it was the right php.ini? What does phpinfo() say about the INI files parsed (at the top) and the various settings (in a big section later)?

Then you didn't set it in the right place. Are you sure it was the right php.ini? What does phpinfo() say about the INI files parsed (at the top) and the various settings (in a big section later)?

 

according to php_info the loaded conf file is /private/etc/php.ini and thats the one I changed.

ok so the problem was these lines in php.ini file:

 

;  Default Value: E_ALL & ~E_NOTICE

;  Development Value: E_ALL | E_STRICT

;  Production Value: E_ALL & ~E_DEPRECATED

 

I was getting this error when I ran php -v in the terminal:

PHP:  parse error in /private/etc/php.ini on line 111

 

Just commented those out and it works now ... I wonder if I'm just not getting the date.timezone error because I commented out the error reporting stuff

Those lines are meant as examples, and should never have been uncommented. What does phpinfo() show for your error_reporting and display_errors values?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.