Since we can set Virtualmin to log PHP Error Log in php settings
My php logs are ALWAYS in UTC despite everything (I think) is set to Europe/Brussels on my server
when PHP Error Log file is set to default /home/USER/logs/php_log
If I set PHP Error Log file to “PHP logging disabled”
The error are going to the apache error_log and the time is working (Europe Brussels)
Do you have an Idea how to set the time for the “default PHP Error Log file/home/USER/logs/php_log”?
Set the timezone setting it the relevant php.ini file(s) for the version of php in use
find the line
;date.timezone =
to
date.timezone = “Europe/Brussels”
then restart apache & php-fpm (if your using fpm)
however it must be noted that a script you are running may modify this value at runtime and changing the ‘php.ini’ will be ignored.
example :-
Unfortunatly I allready set this in my “/home/USER/etc/php8.0/php.ini” in my
/etc/php/8.0/apache2/php.ini
/etc/php/8.0/cgi/php.ini
/etc/php/8.0/cli/php.ini
/etc/php/8.0/fpm/php.ini
(My virtual server is set to php 8.0 FCGI)
Works for me … I guess the script is altering the timezone for example if you are using that virus ( ) known as wordpress there is, I would guess, a timezone setting which by default is set to UTC I found this which relates to wordpress but there are other php scripts out there that does the same thing
I started replying to you that I was using wordpress but it wasn’t related since I set the right timezone in my wordpress settings…
BUT !
I decided to create a php file in the root directory where I made and error and the error appeared in the log with the right timezone !
I’ll search how to resolve this and i’ll come back here.