Why is my PHP error log 2 hours behind?

When checking php.ini, both from phpinfo and php -i on the command line, my time zone is set to Africa / Johannesburg. Therefore, my time zone is GMT +2.

I wrote a small snippet to check the correct time:

echo date('h:i A', time()); echo '<br />' . ini_get('date.timezone'); 

and this outputs the correct time corresponding to my local system time.

However, when I look at my php error log, is the time on each element of the error log exactly two hours behind? Why is this and how can I fix it.

There are also problems with Zend Cache, and I think this time issue is causing it.

+4
source share
2 answers

It seems that PHP is configured with one time zone, and the server on which it is running is configured to a different time zone (possibly GMT / UTC). This means all file operations, etc. Will work with a different time zone for your PHP scripts.

Check the system time zone of your server.

+1
source

Google-fu: read that official PHP site .

0
source

Source: https://habr.com/ru/post/1314171/


All Articles