The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

turn php error reporting on for one site

Discussion in 'General Discussion' started by dxm, Sep 25, 2009.

  1. dxm

    dxm Active Member

    Joined:
    Aug 1, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    php error reporting is turned off server wide.
    However I need to turn the display of errors on for one site.
    That site is running php 5 in cgi mode and apache suexec is enabled.
    I've been trying all sorts of .htaccess and php.ini combos to no avail.
    Can anyone tell me what should work with this combination of php 5 and cgi etc?

    thanks
     
  2. MattCurry

    MattCurry Well-Known Member

    Joined:
    Aug 18, 2009
    Messages:
    275
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Houston, Tx
    PHP Error Reporting for one site

    Hello,

    I do see what you are trying to do, and yes this can be accomplished. In this case you would simply need to edit the users php.ini file and add the following:

    display_error = off
    log_errors = On
    error_log = "error.log"


    If your user doesn't have a php.ini file you may have to create one. This will go in the public_html folder for that user.
    Please let me know if you have any other questions.

    Thank you,
    Matthew Curry
     
  3. dxm

    dxm Active Member

    Joined:
    Aug 1, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    That seems to be logging to error_log in public_html which is a definitely improvement! However, how can I get errors to show in the browser too?

    I ask as I know that the customer will prefer this. Do I need to restart apache when I make changes to this php.ini file by the way?


    thanks
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Be very careful about displaying PHP errors. These can very easily contain sensitive information that you may not want to have publicly displayed.

    display_errors = on will enable the display of errors. However, as with anything in PHP and server administration in general, be mindful of the security implications of doing this.
     
  5. dxm

    dxm Active Member

    Joined:
    Aug 1, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, unfortunately I'm not seeing syntax errors reported to the browser.
    I understand the warning, this is just a temporary measure for debugging purposes.
     
Loading...

Share This Page