Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is php error reporting (in code) by php file or by website?

Tags:

php

Caveat: I am new to PHP.

I have a very old php website that is producing a 300 MB php-errors.log file each day. I am trying to clean up some of the errors. I found out that 70% of the messages are coming from one php file. I temporarily want to turn off the notify messages for that particular module.

I read on php.net error reporting that I can retrieve and set the error_reporting level. Does setting the error reporting level change the reporting only for the php file it was set? Or will it change the settings for the entire site?

like image 439
Mel Avatar asked Feb 03 '26 06:02

Mel


1 Answers

You can change the error reporting for the currently running application from that point on.

If you turn it off for myscript.php and that file include()s or require()s more files, those files will have error reporting changed too unless you override it again.

like image 140
Jared Avatar answered Feb 04 '26 21:02

Jared