Running PHP as a CGI under apache - problems.
Posted on 2005-03-09
Hopefully this is thebest place to ask..
I'm trying to run PHP as a cgi under apache, I have takent he following steps:
create a softlink from /usr/bin/php to the user cgi-bin dir.
in .htaccess in the htdocs dir, i put:
Action php-suid /cgi-bin/php
AddHandler php-suid .sphp
Then I create a very simple php file in the same htdocs dir, just echos a single line. Im sure it executes properly since I can run "php test.sphp" and it works fine.
So now, when I try to browse here, I get http error 500 and in error_log i get:
"....Premature end of script headers: php"
One note - cgi's are being run suexec, (which is why I am going through this all to begin with).
From what I've read, this should be working.. Any ideas anyone?
All help appreciated.