Jump to content

Timezone error_log errors


Recommended Posts

Hello!

My error_log file keeps getting spammed with this:

[Sun Feb 01 01:37:30 2015] [warn] [client xxx.xxx.xx.228] mod_fcgid: stderr: PHP 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 'Europe/Berlin' for 'CET/1.0/no DST' instead in /www/public/min/lib/HTTP/ConditionalGet.php on line 358, referer: http://domain.com/user/2076-randomUserLink/ 

How can I fix this? :)

Link to comment
Share on other sites

By setting the date.timezone in your php.ini.. probably to 'Europe/Berlin'

You can adjust also your timezone running from ssh:

tzselect

 

​So you guys are suggesting on setting my Timezone to Europe/Berlin? Would that made the problem go away?

Link to comment
Share on other sites

When I run tzselect I get this:

 


Please identify a location so that time zone rules can be set correctly. Please select a continent or ocean.  1) Africa  2) Americas  3) Antarctica  4) Arctic Ocean  5) Asia  6) Atlantic Ocean  7) Australia  8) Europe  9) Indian Ocean 10) Pacific Ocean 11) none - I want to specify the time zone using the Posix TZ format.

 

 

What would option 11 do? My server is located in France by the way. :)

Link to comment
Share on other sites

Don't use the 11 option.

If you want to set it to German or France use the 8)Europe option....

The easy way is working fine :)

​Thank you! I set it to Europe/Paris and now I'll wait and see if the error log gets generated again. :)

Speaking about logs, how can I stop apache from writing the access_log file? The file becomes 100MB+ in size each day. :/

Link to comment
Share on other sites

​Thank you! I set it to Europe/Paris and now I'll wait and see if the error log gets generated again. :)

Speaking about logs, how can I stop apache from writing the access_log file? The file becomes 100MB+ in size each day. :/

It is not recommend it to disable error logging as you will not be able to find any problems in the feature....

100MB daily is not so huge and you can set if you want a cron to clear it once per day at 05:00 AM for example....

If you realy want to disable the logging just find the Apache config file:

httpd.conf

and comment the two lines like this:

#CustomLog logs/access_log common
#ErrorLog logs/error_log
Link to comment
Share on other sites

It is not recommend it to disable error logging as you will not be able to find any problems in the feature....

100MB daily is not so huge and you can set if you want a cron to clear it once per day at 05:00 AM for example....

If you realy want to disable the logging just find the Apache config file:

httpd.conf

and comment the two lines like this:

#CustomLog logs/access_log common
#ErrorLog logs/error_log

​I mainly just want to stop the access_log because that doesn't really report any errors but rather all site visits.

 

​Where are you setting it? See my screenshot for how I have it set in my servers php.ini

datetime.thumb.PNG.bca4bef6f2534bb2d544d

​I simply ran tzselect in SSH and chose Europe/Paris. I'm now trying Europe/Berlin to see if it fixes it. :)

Link to comment
Share on other sites

I was not aware that tzselect would interact with PHP other than it changing the operating systems timezone. The error that you pasted in your first post informs you of the two fixes available; the issue is not with the OS timezone but with the PHP configured timezone.

Link to comment
Share on other sites

It seems that you can safely hide this error by editing the php.ini:

Run the php --ini and check where is your php.ini and edit it by adding this line:

date.timezone = "France/Paris"

Then restart php and let us know if it works...

If you did the above edit to Apache httpd.conf then restart Apache and check it....

​This is what my php.ini looks like on the date.timezone part:

[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
;date.timezone =

; http://www.php.net/manual/en/datetime.configuration.php#ini.date.default-latitude
;date.default_latitude = 31.7667

; http://www.php.net/manual/en/datetime.configuration.php#ini.date.default-longitude
;date.default_longitude = 35.2333

; http://www.php.net/manual/en/datetime.configuration.php#ini.date.sunrise-zenith
;date.sunrise_zenith = 90.583333

; http://www.php.net/manual/en/datetime.configuration.php#ini.date.sunset-zenith
;date.sunset_zenith = 90.583333

Am I supposed to remove the ";" in front before adding that? :)

Link to comment
Share on other sites

Hi :)

Yes i thought the same that it should work by editing the php.ini but the setup is very bad and complicated and was not work :(

Don't remember what exactly i was change as i do not have the file now but i was disable a function that the user was needed anyway...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...