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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.