Hasan
Hasan

Reputation: 13

Do not turn off error in my page

I am using

error_reporting(0);
error_reporting(E_NONE);
ini_set("display_errors", "off");
ini_set("display_errors", 0);

But error still show on my page

Warning: xxxxxxxxxxx

Upvotes: 0

Views: 51

Answers (2)

ern
ern

Reputation: 71

In your case you are getting a warning..Which produced by E_WARNING..It may be thrown because of a failed db connection..Execution of script will not be halted but it maybe still a problem..

http://php.net/manual/errorfunc.constants.php

If it's a db connection warning writing exceptions is a good practice

http://php.net/manual/en/language.exceptions.php

if you want to ignore warnings try:

error_reporting(E_ALL ^ E_WARNING);

but please don't use error_reporting(0);

Because these are errors,you need to fix them,and the execution of the script will be halted

Use

error_reporting(E_ALL);
ini_set("display_errors", 1);

in development..

Upvotes: 0

Federkun
Federkun

Reputation: 36964

  1. There's no E_NONE in php.
  2. There's no display_error, only display_errors

Upvotes: 4

Related Questions