David.. Posted February 1, 2015 Posted February 1, 2015 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?
Rugger Posted February 1, 2015 Posted February 1, 2015 By setting the date.timezone in your php.ini.. probably to 'Europe/Berlin'
ASTRAPI Posted February 1, 2015 Posted February 1, 2015 You can adjust also your timezone running from ssh:tzselect
David.. Posted February 1, 2015 Author Posted February 1, 2015 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?
ASTRAPI Posted February 1, 2015 Posted February 1, 2015 Try it and let us know It is something that you must set correct anyway
David.. Posted February 1, 2015 Author Posted February 1, 2015 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.
ASTRAPI Posted February 1, 2015 Posted February 1, 2015 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...
David.. Posted February 1, 2015 Author Posted February 1, 2015 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. :/
David.. Posted February 1, 2015 Author Posted February 1, 2015 Still got that error message after setting Timezone to Europe/Paris...
ASTRAPI Posted February 1, 2015 Posted February 1, 2015 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
Rugger Posted February 1, 2015 Posted February 1, 2015 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
David.. Posted February 1, 2015 Author Posted February 1, 2015 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 I simply ran tzselect in SSH and chose Europe/Paris. I'm now trying Europe/Berlin to see if it fixes it.
David.. Posted February 1, 2015 Author Posted February 1, 2015 Unfortunately, still the same error even with Europe/Berlin. :/
ASTRAPI Posted February 1, 2015 Posted February 1, 2015 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...
Rugger Posted February 1, 2015 Posted February 1, 2015 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.
David.. Posted February 1, 2015 Author Posted February 1, 2015 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?
ASTRAPI Posted February 1, 2015 Posted February 1, 2015 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
David.. Posted February 2, 2015 Author Posted February 2, 2015 Thank you ASTRAPI & Rugger but the warning still persists.I think it only gets generated for specific IP's and not for every visitor?
David.. Posted February 2, 2015 Author Posted February 2, 2015 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!
Rugger Posted February 2, 2015 Posted February 2, 2015 @ASTRAPI what changes did you make to the file? I looked at the code and don't see why fixing it in the php.ini would not have worked :?
ASTRAPI Posted February 2, 2015 Posted February 2, 2015 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...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.