ballhogjoni Posted May 24, 2012 Share Posted May 24, 2012 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" Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/ Share on other sites More sharing options...
requinix Posted May 24, 2012 Share Posted May 24, 2012 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)? Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348182 Share on other sites More sharing options...
ballhogjoni Posted May 24, 2012 Author Share Posted May 24, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348203 Share on other sites More sharing options...
kicken Posted May 24, 2012 Share Posted May 24, 2012 Is the setting uncommented in the file (no ; before it)? Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348225 Share on other sites More sharing options...
ballhogjoni Posted May 25, 2012 Author Share Posted May 25, 2012 Is the setting uncommented in the file (no ; before it)? Yes i removed the ; Also I am editing as root. Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348467 Share on other sites More sharing options...
salathe Posted May 25, 2012 Share Posted May 25, 2012 If you're using Apache, did you stop and start it? Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348527 Share on other sites More sharing options...
ballhogjoni Posted May 25, 2012 Author Share Posted May 25, 2012 If you're using Apache, did you stop and start it? yes Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348689 Share on other sites More sharing options...
ballhogjoni Posted May 26, 2012 Author Share Posted May 26, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348830 Share on other sites More sharing options...
Pikachu2000 Posted May 26, 2012 Share Posted May 26, 2012 Those lines are meant as examples, and should never have been uncommented. What does phpinfo() show for your error_reporting and display_errors values? Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348835 Share on other sites More sharing options...
ballhogjoni Posted May 27, 2012 Author Share Posted May 27, 2012 display_errors Off Off display_startup_errors Off Off error_log no value no value error_reporting 22527 22527 Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348868 Share on other sites More sharing options...
Pikachu2000 Posted May 27, 2012 Share Posted May 27, 2012 While you're developing, you should have error_reporting = -1 and display_errors = On directives in your php.ini file. Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348872 Share on other sites More sharing options...
ballhogjoni Posted May 27, 2012 Author Share Posted May 27, 2012 ya I tried that but the phpinfo still reports that display_errors is Off Quote Link to comment https://forums.phpfreaks.com/topic/263026-warning-date-functiondate-it-is-not-safe-to-rely-on-the-systems-timezone/#findComment-1348877 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.