Adjusting Error Reporting in PHP

Once you have PHP set to reveal what errors occur, you might want to adjust the level of error reporting. Your PHP installation as a whole or individual scripts can be set to report or ignore different levels of errors. Table 6.1 lists most of the levels, but they can generally be one of these three kinds:

  • Notices, which do not stop the execution of a script and may not necessarily be a problem.

  • Warnings, which indicate a problem but don’t stop a script’s execution.

  • Errors, which stop a script from continuing (including the ever-common parse error, which prevent scripts from running at all).

Table 6.1. PHP’s error-reporting settings, to be used with the error_reporting() function or in the php.ini file.
Error-Reporting ...

Get PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.