From c5fa313b0e34d4cf7e73f1f88a006d14bd48eab0 Mon Sep 17 00:00:00 2001 From: Gerard Roche Date: Sat, 1 Dec 2012 11:10:46 +0000 Subject: [PATCH] Update _posts/07-07-01-Error-Reporting.md --- _posts/07-07-01-Error-Reporting.md | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/_posts/07-07-01-Error-Reporting.md b/_posts/07-07-01-Error-Reporting.md index 1eee78d..1562a38 100644 --- a/_posts/07-07-01-Error-Reporting.md +++ b/_posts/07-07-01-Error-Reporting.md @@ -11,22 +11,21 @@ production (live). ### Development -To show errors in your development environment, configure the following settings in your `php.ini`: +To show every possible error during development, configure the following settings in your `php.ini`: -- display_errors: On -- error_reporting: -1 -- log_errors: On + display_errors = On + display_startup_errors = On + error_reporting = -1 + log_errors = On -From [php.net](http://php.net/manual/function.error-reporting.php): - -> Passing in the value -1 will show every possible error, even when new levels and constants are added in future PHP versions. The E_ALL constant also behaves this way as of PHP 5.4. +> Passing in the value `-1` will show every possible error, even when new levels and constants are added in future PHP versions. The `E_ALL` constant also behaves this way as of PHP 5.4. - [php.net](http://php.net/manual/function.error-reporting.php) The `E_STRICT` error level constant was introduced in 5.3.0 and is not part of `E_ALL`, however it became part of `E_ALL` in 5.4.0. What does this mean? In terms of reporting every possible error in version 5.3 it means you must use either `-1` or `E_ALL | E_STRICT`. -**Reporting Every Possibly Error by PHP Version** +**Reporting every possible error by PHP version** * < 5.3 `-1` or `E_ALL` *   5.3 `-1` or `E_ALL | E_STRICT` @@ -34,15 +33,17 @@ use either `-1` or `E_ALL | E_STRICT`. ### Production -To hide the errors on your production environment, configure your `php.ini` as: +To hide errors on your production environment, configure your `php.ini` as: -- display_errors: Off -- error_reporting: E_ALL -- log_errors: On + display_errors = Off + display_startup_errors = Off + error_reporting = E_ALL + log_errors = On With these settings in production, errors will still be logged to the error logs for the web server, but will not be shown to the user. For more information on these settings, see the PHP manual: -* [Error_reporting](http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting) -* [Display_errors](http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors) -* [Log_errors](http://www.php.net/manual/en/errorfunc.configuration.php#ini.log-errors) \ No newline at end of file +* [error_reporting](http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting) +* [display_errors](http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors) +* [display_startup_errors](http://php.net/manual/errorfunc.configuration.php#ini.display-startup-errors) +* [log_errors](http://www.php.net/manual/en/errorfunc.configuration.php#ini.log-errors) \ No newline at end of file