PHP Basics – How to disable notice and warning in PHP.ini file

To disable notice and warning in PHP is quite easy to do, but easy to forget how to do it 😉

Just open right php.ini file (VERY IMPORTANT to find RIGHT php.ini file) search for line error_reporting under “Error handling and logging” section and give variable as E_ALL & ~E_NOTICE & ~E_WARNING

Line should look like this:

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING

restart webserver (Apache in most case) and you are done. Now you will not get those pesky notice and warning messages 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.