A quick way to turn on/off PHP errors.
Make sure to disable
debug mode in production! Displaying PHP errors on a public server can be a serious security risk:
- Error messages are displayed with detailed information about the code structure (e.g. file path, class, method)
- With Whoops enabled, there will be even more detailed information about the code structure
In a production environment, always log errors to your PHP error logs.
To avoid accidentally enabling debugging in production, but to still be able to use it in certain situations, you have different options:
config.phpand only enable it in in the config for your local/staging setup, see Multiple config files
Use conditions for the
config.php, e.g. based on server name or logged in users
See also: Debugging basics