docs:programming:php:error_handling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docs:programming:php:error_handling [2007/03/23 22:56] – created billhdocs:programming:php:error_handling [2008/08/03 00:25] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Error Handling ====== ====== Error Handling ======
 Normally, when an error occurs in a PHP script, the error message is inserted into the script's output.  If the error is fatal, the script execution stops. Normally, when an error occurs in a PHP script, the error message is inserted into the script's output.  If the error is fatal, the script execution stops.
 +
 +
 +===== Production Server Configuration =====
 +Make sure to modify the php.ini file as shown below.  This will display a blank page without errors to the user if there is a problem.  You can enable logging to keep track of errors, which is done slightly below these lines.
 +  * Note:  Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.
 +<code>
 +; Print out errors (as a part of the output).  For production web sites,
 +; you're strongly encouraged to turn this feature off, and use error logging
 +; instead (see below).  Keeping display_errors enabled on a production web site
 +; may reveal security information to end users, such as file paths on your Web
 +; server, your database schema or other information.
 +display_errors = Off
 +
 +; Even when display_errors is on, errors that occur during PHP's startup
 +; sequence are not displayed.  It's strongly recommended to keep
 +; display_startup_errors off, except for when debugging.
 +display_startup_errors = Off
 +</code>
  
 ===== Changing Error Reporting ===== ===== Changing Error Reporting =====
  • docs/programming/php/error_handling.1174712215.txt.gz
  • Last modified: 2008/08/03 00:25
  • (external edit)