httpd.conf settings:
- Code: Select all
Alias /error/ "/var/www/error/"
ScriptAlias /php-cgi/ "/var/www/php-cgi/"
php.include (included by the httpd.conf)
- Code: Select all
#LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php .php4 .php3 .phtml
DirectoryIndex index.php index.php3
AddHandler application/x-httpd-phpcgi .php .pcgi .php3 .phtml
Action application/x-httpd-phpcgi /php-cgi/php.cgi
/var/www/php-cgi/php.cgi:(which i got from another website, probably the problem)
- Code: Select all
#!/bin/sh
PHPCGI_SCRIPT=`echo $PATH_INFO | sed -e s/.*\\\\///`
export PATH_TRANSLATED=$PWD/$PHPCGI_SCRIPT
/usr/bin/phpcgi
/usr/bin/phpcgi is a php binary i just compiled with the --enable-force-cgi-redirect option
my test.php script:
- Code: Select all
<?
system("whoami");
?>
The result of test.php, 500 internal server error.
The log entry in error_log:
- Code: Select all
[Fri Apr 01 03:09:21 2005] [error] [client 24.22.xxx.xxx] Premature end of script headers: php.cgi
Does anyone have any idea what I can do to fix this? I've been curious about php as cgi for a while now, and would like to finally learn how to get it working properly.
update: apparently any cgi does this... while i was trying to debug it, i created another cgi script which also resulted in 500:
- Code: Select all
#!/bin/sh
echo Content-type: text/plain
echo
echo
set


