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.

"Premature end of script headers" (suPHP after Upgrade)

Discussion in 'General Discussion' started by Owl, Oct 25, 2015.

  1. Owl

    Owl Member

    Joined:
    Oct 25, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    'Merica
    cPanel Access Level:
    Root Administrator
    Hello,

    I attempted to upgrade server today using EasyApache 3 (as i have done many times). This time around, I started receiving 500 error messages after the update (Apache 2.2 and PHP5). Looking at the error logs, I found the following:

    "Premature end of script headers: index.php"

    I discovered that if I change the PHP handler to any of the other options (like dso) the page will display as normal. As far as I'm aware, I had not changed any other settings when updating, so I'm not sure why this is suddenly a problem.

    I set the suPHP debugging level to info for a moment, but the only log that I got was one noting Executing as UID/GID. The numbers it shows are accurate to what they should be executing as.

    I found other related questions like this, however none of those solutions worked for me. Any help would be much appreciated.

    Thanks!
     
  2. Owl

    Owl Member

    Joined:
    Oct 25, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    'Merica
    cPanel Access Level:
    Root Administrator
    Looks like I spoke too soon... dso worked for the front page of one of my sites. And throws errors on the rest. Also, CGI throws 500 errors as well... Might be something deeper.
     
    #2 Owl, Oct 25, 2015
    Last edited: Oct 25, 2015
  3. Owl

    Owl Member

    Joined:
    Oct 25, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    'Merica
    cPanel Access Level:
    Root Administrator
    For others who are seeing this, the (hopefully temporary) solution I've gotten to work is disable suExec, switch your handler to fastCgi, and then go through and update the permissions on your files to allow your apache user (usually "nobody") the same permissions as the regular user you were running as.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Were there any additional messages in /usr/local/apache/logs/error_log when the website failed to load? While your solution may have worked, it's generally advised to determine the cause of the problem rather than disabling suexec and modifying file ownership.

    Thank you.
     
  5. Owl

    Owl Member

    Joined:
    Oct 25, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    'Merica
    cPanel Access Level:
    Root Administrator
    Absolutely agree that I'd love to actually fix the problem. There are no other logs generated in the error_log beside "Premature end of script headers: index.php".
     
  6. madmanmachines

    madmanmachines Well-Known Member

    Joined:
    Nov 28, 2014
    Messages:
    94
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi,

    With the suPHP handler, have you ensured proper permissions(http://boomshadow.net/tech/fixes/fixperms-script/)? I'd also recommend temporarily disabling your firewall and testing if your code makes calls to external resources. You can also debug with the `strace' command and by executing the code manually from the terminal.

    Thanks,
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  8. Owl

    Owl Member

    Joined:
    Oct 25, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    'Merica
    cPanel Access Level:
    Root Administrator
    @madmanmachines -- Ran that script. Same error occurring. Also, it won't be a firewall issue since everything was running just fine previously to updating apache.

    @cPanelMichael -- There's nothing in that log. Any other ideas?
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's difficult to determine the exact reason if you are no longer using the same environment. Feel free to let us know if the issue persists after switching suExec to "On".

    Thank you.
     
Loading...

Share This Page