Is it possible to configure display errors in .htaccess?

0

In the information about my hosting service, there is a line saying that I can not change php.ini , but that I can change most settings through .htaccess . I would like to enable the errors through .htaccess if possible, and only disable Notices . Is this possible?

    
asked by anonymous 28.03.2017 / 17:53

1 answer

1

It is possible as long as the environment (server) allows access to such settings.

There is not much to say about what works or not because who can answer is the support of the hosting service.

You can usually enable or disable using php_flag

php_flag display_errors on

Do this in htaccess and see what happens. Normally when it is not allowed it returns an "internal error", "error 500" and things like.

Alternatively, make sure your hosting provider supports custom php.ini. Most modern hosts offer by default. However, it's pretty restrictive, especially if it's a shared host.

One suggestion is to configure the error log instead of display_error as ON .

The default production environment is always OFF because it helps protect the general site from exposing sensitive information when there is an error.

    
28.03.2017 / 19:35