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

Owl

Member
Oct 25, 2015
5
0
1
'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!
 

Owl

Member
Oct 25, 2015
5
0
1
'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.
 
Last edited:

Owl

Member
Oct 25, 2015
5
0
1
'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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
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.
 

Owl

Member
Oct 25, 2015
5
0
1
'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".
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
You can also review /usr/local/apache/logs/suphp_log to see if there's any additional information about suPHP in this log.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
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.