Is it possible to configure the display errors in . htaccess?

Asked

Viewed 869 times

0

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

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.

Normally you can enable or unbox using php_flag

php_flag display_errors on

Do this in htaccess and see what happens. Usually when not allowed returns an "Internal error", "error 500" and things like.

Alternatively, make sure the hosting provider supports custom php.ini. More modern hosts offer by default. However, it’s all very restrictive, especially if it’s shared host.

One suggestion is to set up the bug log instead of the display_error as ON.

The standard of the production environment is always OFF as it helps to protect the site in general from exposing sensitive information when there is an error.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.