Temporarily disable log_errors in php.ini
-
I absolutely need to disable errors log in PHP for a little while, otherwise my document root becomes fill with and increasing by the second errors.log file.
log_errors = On
is enabled by default in the hard coded php.ini of LAMP.I've tried to add
log_errors = Off
to the php.ini file in the root dir of LAMP, thinking it would override the what's set in the php.ini system file, and then restarted the app, but it's not working.
PHP keeps creating an increasing errors log file in the document root. -
@micmc the default value of
log_errors
per https://www.php.net/manual/en/errorfunc.configuration.php is "0". This is not changed in the package. I suspect maybe the app is overwriting this value and this is also why your custom ini changes have no effect. -
@girish said in Temporarily disable log_errors in php.ini:
Mm, the default is different in the package indeed. Some sites say the default value has changed in php 8.0. Maybe upstream docs are not correct.
I put this in php.ini and restarted the app:
log_errors = Off
Yeah, I went to check the server's hard coded php.ini that's why I said it was On by default.
Now, I've checked with a phpinfo.php file and I can see that the log_errors are now off indeed, but the reason I thought it was not is because the app still writes errors.log in the documentroot.
So, what the reason can that possibly be, you think the app itself would write errors.log even though PHP log-errors if Off?