How to display / hide Errors in PHP with htaccess

You can turn on or off the PHP errors and warnings using the htaccess file

Display the PHP errors when developing and hide them when live 😉

php_flag display_errors off


  1. I use the PHP method, you can enable or disable error outputs via PHP, so, when I have the GET variable “debug”, I see the error messages. This way I am the only one who sees the error message even in a production enviroment.

Leave a Reply

Your email address will not be published. Required fields are marked *