0

I'm trying to disable display_errors from .htaccess, but if I just paste this into the .htaccess file, the entire site crashes:

php_flag display_errors off
php_flag log_errors on
4
  • Your host might not allow you to set ini variables in htaccess Commented Dec 1, 2012 at 0:19
  • 1
    What is the error message in the logs when you have the code in .htaccess? Commented Dec 1, 2012 at 0:19
  • If you mean crash as in 500 error, it means you are running as CGI and not as Apache module, do what @dev-null-dweller has instructed with a .user.ini do a phpinfo() to see if the directives mentioned here php.net/manual/en/configuration.file.per-user.php are enabled and the filename you are to use is the same as well. Commented Dec 1, 2012 at 1:00
  • Sorry, I get a server error. The same as when I have a typo. I need to know the EXACT syntax down to the periods and semi-colons. Commented Dec 2, 2012 at 4:04

1 Answer 1

1

This only works if php is compiled as apache module and you have privileges to change those.

If you are using php >= 5.3, there is better solution: create .user.ini file in your document root and use normal ini syntax to customize your config.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.