Running PHP as CGI under apache

From: Date: Wed, 15 Aug 2001 19:04:07 +0000
Subject: Running PHP as CGI under apache
Groups: php.general 
Request: Send a blank email to php-general+get-62826@lists.php.net to get a copy of this message
I'm trying to run a script as CGI under apache, instead of using the apache module, because the module is safe-mode enabled and I need to bypass that for one script. If you put this script into a file (.cgi) and give it executable permissions, you can run it from the command line ------------PHP CODE START------------ #!/usr/bin/php <?php print "Hello"; ?> ------------PHP CODE END------------ and the Content-Type header is added by PHP. But when I put it in my cgi-bin directory it would not execute from a browser - I got internal server error. The error log said "Premature end of script headers." Has anybody been able to find a way round this problem? Running PHP NOT as a module? Thanks a lot.

« previous php.general (#62826) next »