1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to hide php errors

Discussion in 'Web Development & Web Hosting' started by HTF, Dec 10, 2009.

  1. HTF

    HTF Byte Poster

    181
    0
    14
    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):

    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
     
    Certifications: A+
  2. Notes_Bloke

    Notes_Bloke Terabyte Poster

    3,230
    54
    146
    Have you access to the php.ini file?

    If so, change the display_errors to off:-

    eg.

    display_errors = Off

    NB
     
    Certifications: 70-210, 70-215, A+,N+, Security+
    WIP: MCSA
  3. HTF

    HTF Byte Poster

    181
    0
    14
    Hello,

    It was already off so unfortunately it's not working do you know why is like this?

    [​IMG]
    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.

    Your suggestion was great and I though that it will solve the problem but unfortunately not
     
    Last edited: Dec 11, 2009
    Certifications: A+
  4. zr79

    zr79 Byte Poster

    199
    1
    17
    You can also use a @ infront of a line of code.

    @$fo = fopen("file.txt,"r");

    or is it,

    $fo = @fopen("file.txt,"r");
     
    Certifications: A+
  5. Boycie
    Honorary Member

    Boycie Senior Beer Tester

    6,281
    85
    174
    perhaps your script does other things, although you should be able to retrieve that information from cpanel, or perhaps use Google Analytics? for further stats.

    I assume there is no other issues with the site?
     
    Certifications: MCSA 2003, MCDST, A+, N+, CTT+, MCT

Share This Page

Loading...