Jump to content

how to stop errors on page


otuatail

Recommended Posts

Hi I have an include page full of functions in a secure folder with htaccess. My problem is if the include file does not exsist, I get the following.

 

Warning: include(secure/SecureFunctions.php) [function.include]: failed to open stream: No such file or directory in /home/fhlinux190/d/otoole.co.uk/user/htdocs/streetangels/index.php on line 3

 

Warning: include(secure/SecureFunctions.php) [function.include]: failed to open stream: No such file or directory in /home/fhlinux190/d/otoole.co.uk/user/htdocs/streetangels/index.php on line 3

 

Warning: include() [function.include]: Failed opening 'secure/SecureFunctions.php' for inclusion (include_path='.:/usr/share/pear-php5') in /home/fhlinux190/d/otoole.co.uk/user/htdocs/streetangels/index.php on line 3

 

TIA

 

Desmond.

Fatal error: Call to undefined function session_init() in /home/fhlinux190/d/des-otoole.co.uk/user/htdocs/streetangels/index.php on line 6

 

 

Is there any way to suppress this as it is giving hackers information.

Link to comment
Share on other sites

Yes but large systems have many files and things can go wrong. A bug might appear the you never thought of. Best stop the error.

or die(); can be faital

but you could sayor die("Sorry. Error");

 

No, the best thing to do is fix the error.  Saying "I have a large system, it's too hard" is an excuse for not testing and releasing a buggy site.

Link to comment
Share on other sites

On a live server, display_errors should be OFF and log_errors should be ON. You want to log the errors so that you know what is going on and can find and fix whatever is causing them.

 

On a development system, display_errors should ON.

 

Error_reporting should always be as least E_ALL or even better, it should be a -1

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.