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 = Onis enabled by default in the hard coded php.ini of LAMP.I've tried to add
log_errors = Offto 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. -
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 = Onis enabled by default in the hard coded php.ini of LAMP.I've tried to add
log_errors = Offto 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_errorsper 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. -
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 = OffNow, it's fine:

@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 = OffYeah, 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?
-
@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 = OffYeah, 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?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login