dkz

Well-Known Member
Sep 10, 2004
100
0
166
Hello,

I need to have the php files on my server run as the user instead of nobody so I tried to enable suphp. Once I recompile Apache and enable suphp, no php scripts work (500 error). I belive the correct options are checked to run php as cgi. The error is "Premature end of script headers". I've read some previous posts on this exact problem however I have not yet been able to get it to work. The server is OS is CentOS 5 running the release version of cpanel usine Apache 2.2 and PHP 5.2.5.

Any suggestion will be greatly appreciated!
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,217
4
193
Minneapolis, MN
Once I recompile Apache and enable suphp, no php scripts work (500 error). I belive the correct options are checked to run php as cgi. The error is "Premature end of script headers".
When Apache is compiled with SuPhp security feature you can't send php commands via the .htaccess file. Go to: http://www.suphp.org/FAQ.html and read their FAQ and browse their site for more information about other SuPhp issues. You also need to read this HowTo article at: http://servertune.com/kbase/?View=entry&EntryID=184

Hope this helps
 

dkz

Well-Known Member
Sep 10, 2004
100
0
166
Thanks for the suggestions!

I've tried using chmod before but since it is a different owner, it gives me an error.
It's not a .htaccess problem either. I will review the suPHP faq but I was hoping someone knew a quick fix for this problem.

Thanks.
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
Thanks for the suggestions!

I've tried using chmod before but since it is a different owner, it gives me an error.
It's not a .htaccess problem either. I will review the suPHP faq but I was hoping someone knew a quick fix for this problem.

Thanks.
As said above, the cause of this in 99% of cases is either:

  • the file permissions allow write to group or other, or the directory they are in has write permission to group or other;
  • or, the file is owned by someone other than the account the file is in;
  • or, there is a php_* directive in the .htaccess file. They have to be moved into a php.ini file.


I'd triple check each of these just to be sure.