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.

Running a PHP script gives 500 internal server error

Discussion in 'General Discussion' started by mikeg1971, Aug 5, 2011.

  1. mikeg1971

    mikeg1971 Registered

    Joined:
    Aug 5, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    I'm new here. Recently installed CPanel on a testing server/trial license before I purchase a license and put it on a production server. My PHP files are returning a 500 Internal Server error. HTML files work fine however.

    This is on a fresh, clean install on CentOS 5.

    I would be grateful if someone could shed some light on the subject. Apologies if this topic has already been covered.

    Thank you to all in advance.
     
    #1 mikeg1971, Aug 5, 2011
    Last edited: Aug 5, 2011
  2. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    Hello there,

    Please check your PHP handler through WHM (Main >> Service Configuration >> Configure PHP and SuExec), and see if it is set to SuPHP. If so, you need to check the ownership and writes of the files you are trying to load. The ownership should reflect the owner of the account, and the files should not have more that 644 for permissions.

    If this is not the case, I would suggest you check your Apache error log for the reason it is flagging 500 errors.

    Chris
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The Apache error log is at /usr/local/apache/logs/error_log location. To check it when loading a site in a browser, you can do:

    Code:
    tail -fn0 /usr/local/apache/logs/error_log
     
  4. mikeg1971

    mikeg1971 Registered

    Joined:
    Aug 5, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi again,

    Thanks for your replies. I've turned SUExec off, now the 500 error has gone, but PHP files tries to download when I load them, seems like PHP isn't setup right somehow...

    By the way plain html files work fine.

    Regards,

    Mike
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello Mike,

    Did you tail the Apache error log when suExec was turned on to see the return upon browsing the page that isn't working?

    Thanks!
     
Loading...

Share This Page