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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.