mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-19 03:51:15 +02:00
Fix highlighter consistency
- in some places php would not be highlighted as the `<?php` tag was missing - in one place there was a duplicate `<?php` tage - replaced `bash` with `console` for better highlighting - ensured all console snippets are wrapped within highlighting code - wrapped ini examples in highlighting code
This commit is contained in:
@@ -7,17 +7,19 @@ anchor: error_reporting
|
||||
|
||||
Error logging can be useful in finding the problem spots in your application, but it can also expose information about
|
||||
the structure of your application to the outside world. To effectively protect your application from issues that could
|
||||
be caused by the output of these messages, you need to configure your server differently in development versus
|
||||
be caused by the output of these messages, you need to configure your server differently in development versus
|
||||
production (live).
|
||||
|
||||
### Development
|
||||
|
||||
To show every possible error during <strong>development</strong>, configure the following settings in your `php.ini`:
|
||||
|
||||
display_errors = On
|
||||
display_startup_errors = On
|
||||
error_reporting = -1
|
||||
log_errors = On
|
||||
{% highlight ini %}
|
||||
display_errors = On
|
||||
display_startup_errors = On
|
||||
error_reporting = -1
|
||||
log_errors = On
|
||||
{% endhighlight %}
|
||||
|
||||
> 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/function.error-reporting)
|
||||
|
||||
@@ -36,10 +38,12 @@ use either `-1` or `E_ALL | E_STRICT`.
|
||||
|
||||
To hide errors on your <strong>production</strong> environment, configure your `php.ini` as:
|
||||
|
||||
display_errors = Off
|
||||
display_startup_errors = Off
|
||||
error_reporting = E_ALL
|
||||
log_errors = On
|
||||
{% highlight ini %}
|
||||
display_errors = Off
|
||||
display_startup_errors = Off
|
||||
error_reporting = E_ALL
|
||||
log_errors = On
|
||||
{% endhighlight %}
|
||||
|
||||
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:
|
||||
|
Reference in New Issue
Block a user