Page 1 of 1

How to hide php errors

Posted: Thu Dec 10, 2009 3:24 pm
by HTF
Hello,

How can I hide php errors like this below for example when I'm accesing my website(I've just changed index file extensions for this example purpose but I had such a errors before):
PHP Warning: include(ip/index.pphp): failed to open stream: No such file or directory in C:\Web\DarkSpace\index.php on line 53
PHP Warning: include(): Failed opening 'ip/index.pphp' for inclusion (include_path='.;C:\php5\pear') in C:\Web\DarkSpace\index.php on line 53
Is it possible that instead of this the browser will be display some HTTP error like error 400 (Bad request) for example or somethomg like that, because in this case everybody see my directory structure ect.

Regards

Re: How to hide php errors

Posted: Thu Dec 10, 2009 3:49 pm
by John Cartwright
..or you could fix the error?

However, you can capture PHP generated errors and notices with set_error_handler()

Re: How to hide php errors

Posted: Thu Dec 10, 2009 6:36 pm
by HTF
Hello,

Basically I have IP tool on my website that is showing visitors IP but I saw today that sometimes there is a slightly delay when the page is loading because of the website that provide the IP data, it's also displaying country flag ect. and I received php error about timing out (60 sec.) during loading the page so I would like to prevent from displaying this error or find some solution in situation when their website is slow what cause that my website is not loading.

I've change 'the display_errors to off' in php.ini so I could prevent from displying any php errors but it's also not working.

Your suggestion was great and I though that it will solve the problem but unfortunately not