Jump to content

Timezone error_log errors


Recommended Posts

Posted

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? :)

Posted

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?

Posted

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. :)

Posted

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 :)

You may need to restart also php just to be sure...

Posted

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. :/

Posted

​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
Posted

Still got that error message after setting Timezone to Europe/Paris... 

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

datetime.thumb.PNG.bca4bef6f2534bb2d544d

Posted

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. :)

Posted

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 Apache and let us know if it works...

Posted

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.

Posted

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? :)

Posted

Replace this:

;date.timezone =

with this:

date.timezone = "France/Paris"

Don't forget to remove the ; before the line :)

Then restart Apache and php and check it :)

Posted

Turns out the problem was the ConditionalGet.php file. @ASTRAPI modified it a bit and it's been an hour or so now since the last error. I think it has been fixed but I will wait a bit longer to double verify it. :)

I'll report back!

Thank you!

Posted

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...

Archived

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

  • Recently Browsing   0 members

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