How to access php error log

Discussion in 'Free Hosting' started by sperko, Feb 17, 2016.

Thread Status:
Not open for further replies.
  1. sperko

    sperko Member

    Messages:
    258
    Likes Received:
    4
    Trophy Points:
    18
    Do free hosting accounts get access to the php error logs?

    If they do, how do I access them?

    Thank you
     
    Last edited: Feb 17, 2016
  2. bdistler

    bdistler Well-Known Member Prime Account

    Messages:
    3,534
    Likes Received:
    196
    Trophy Points:
    63
    • Like Like x 1
  3. sperko

    sperko Member

    Messages:
    258
    Likes Received:
    4
    Trophy Points:
    18
    how do I view the php error log in the file manager?
     
    Last edited: Mar 22, 2016
  4. caftpx10

    caftpx10 Well-Known Member

    Messages:
    1,535
    Likes Received:
    114
    Trophy Points:
    63
    A very important thing I should point out is that display_errors SHOULD be disabled for production for security purposes. It's good for a quick look at for errors when testing but you wouldn't want users to see the information that it would put out.

    In cPanel x3, go to Select PHP Version > Switch to PHP Settings
    Do the following changes to the listed directives/options:
    display_errors = Off
    log_errors = On

    After that press 'save'. Next time when an error/warning/notice/whatever occurs, it won't appear in the browser but it will be logged in 'error.log' files.
    Note that these files will be created where the code execution occurs. So if /blah.php gets an error then it would be in /error.log and if /fruit/lemon.php gets an error then it would be /fruit/error.log

    You can access these files via file manager or via FTP by opening them as if you're editing code in a file.


    What I should also point out is that you should deny access to the file error.log to everyone so that they can't read it unless they have other forms of access such as FTP. I don't know if the file manager would be affected but it's worth trying.
     
    • Winner Winner x 1
  5. sperko

    sperko Member

    Messages:
    258
    Likes Received:
    4
    Trophy Points:
    18
    I think that's exactly what I was looking for

    thanks for the great answer!
     
    Last edited: Mar 22, 2016
Thread Status:
Not open for further replies.

Share This Page