iEoj
iEoj

Reputation: 70

How to stop public seeing error messages in PHP

Pretty much if i mistake does happen in my php i do not want the public to see the error for security purposes, is there anyway of having like a log or file that only people with that file or access can see it?

Upvotes: 0

Views: 45

Answers (2)

Slothrop
Slothrop

Reputation: 142

You'll need to set the flag with php_flag log_errors on, then use php_value error_log path to log file

To suppress warnings/errors you can use php_flag display_errors off

Upvotes: 0

Sanjay Kumar N S
Sanjay Kumar N S

Reputation: 4739

Use the following line as the first line:

   error_reporting(0);

Another alternative is the .htaccess file.

Upvotes: 1

Related Questions