How do I disable ALL error messages via php.ini?
63,164
The display error statement is not what you actually want. You should change also the error_reporting value if you don't want to have the messages informing you about the error.
You should try this for all errors
error_reporting = off
or
error_reporting = E_ALL & ~E_DEPRECATED
this will keep letting you know about the errors but they will be invisible to other users..
Related videos on Youtube
Author by
PeanutsMonkey
Updated on September 18, 2022Comments
-
PeanutsMonkey almost 2 years
Despite the following settings below, I often see the path to the file producing the error. How do I turn off ALL errors no matter what?
error_reporting = E_ALL display_errors = off log_errors = off
-
Bort over 11 yearsWhat command is giving the error, and what error is it showing?
-
PeanutsMonkey over 11 years@Bort - I would like it not to show file paths assuming there is a coding error, etc
-
-
PeanutsMonkey over 11 yearsThanks but how do I change it within the php.ini file as opposed to a php file?
-
Bort over 11 yearsJust be sure to continue logging the errors, otherwise you will wish you did when something bad happens.
-
Jack over 11 years@PeanutsMonkey can't you edit the php.ini file with an editor??i guessed the server was at your machine.
-
PeanutsMonkey over 11 years@Jack - Yes it is. I thought that
error_reporting(0);
is limited to PHP files not the php.ini file. -
PeanutsMonkey over 11 years@Jack - I put the line of code i.e.
error_reporting(0);
and it literally killed the web server. Why is that? I had to remove it before I could bring it back up again. -
Jack over 11 years@PeanutsMonkey you are right, this was my fault, i edited the answer, hope it helps now...