To stop PHP from logging notices and warnings to error log files, you can adjust the error_reporting
setting in the php.ini
file.
Here’s how to make this change:
- Locate your
php.ini
file. On Linux, it’s usually located at/etc/php.ini
. - Open the
php.ini
file in a text editor. - Find the
error_reporting
setting. It’s usually near the top of the file. (Zolpidem) - Change the value to
E_ALL & ~E_NOTICE & ~E_WARNING
. This will log all errors except notices and warnings. - Save the file and exit the text editor.
- Restart your web server for the changes to take effect.
After you’ve made these changes, notices and warnings will no longer be logged to your error log files.