PHP Error Log are always in UTC time

Hello

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”?

SYSTEM INFORMATION
OS type and version Ubuntu 20.04.6 LTS
Virtualmin version 7.7-3

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

Thanks for your reply

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)

And logs are still in UTC

you did restart the services ?

service apache2 restart

Yes

Works for me … I guess the script is altering the timezone for example if you are using that virus (:slight_smile: ) 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

1 Like

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.

Thanks!

I decided to disable PHP error log and look at apache error log for my errors…
It’s intended by Wordpress to force UTC… I’ll not fight against them!

But please don’t say Wordporess is a virus! #WordpressLover :wink:

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.