Jump to content

Recommended Posts

Posted

Hi,

I am trying to turn off errors like warnings, notices and so on. But It's seems like I am unable to turn of error reporting.

I even tried to turn off all warnings using error_reporting(0)

I hope to get your help soon.

Posted

error_reporting(0); should definitely work. Are you sure your software doesn't have logic in it somewhere that turns it back on?

Posted

hi wolstech,

I just checked on test file.

Code:

<?php
error_reporting(0);
$ggs->hf = 'bfdnb'
?>
Result:

Parse error: syntax error, unexpected end of file in /home1/mrj/public_html/test.php on line 3
Posted

I did write in wrong syntax. But it's not supposed to show errors. As you can see the file is a standalone file. Please help me.

Posted

Error reporting can't be disabled for syntax errors.

 

It works just fine: With it off https://www.raxsoft.com/temp/no_error.php and on https://www.raxsoft.com/temp/error.php

 

no_error.php:

<?php
error_reporting(0);
mysql_fetch_array($null);

?>

error.php

<?php
mysql_fetch_array($null);

?>


More than likely the software you're using hijacks the error reporting state and tries to control it on its own. You'll need to either check for an option in the software (usually hiding in a config file), or go through the source code of the software you're using and comment out any error_reporting options that it tries to set.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...