diff --git a/_posts/07-07-01-Error-Reporting.md b/_posts/07-07-01-Error-Reporting.md index 9fd4094..3d84b5c 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://php.net/manual/errorfunc.configuration.php#ini.error-reporting) * [display_errors](http://php.net/manual/errorfunc.configuration.php#ini.display-errors) -* [log_errors](http://php.net/manual/errorfunc.configuration.php#ini.log-errors) \ No newline at end of file +* [display_startup_errors](http://php.net/manual/errorfunc.configuration.php#ini.display-startup-errors) +* [log_errors](http://php.net/manual/errorfunc.configuration.php#ini.log-errors)