This is my first night with PHP so bear with me.

I'm getting the standard "500 Internal Server Error" and cannot troubleshoot the problem.

Here is what I'm running:
PHP 5.2.5 (resides in c:/web/php)
Apache 2.2.8 (resides in c:/web/apache)

I have a simple script called test.php:

<?php
print "Hello World!\n";
?>

The script, PHP and my $PATH are all in working order because I can execute php with no problem via command line:
[/cygdrive/c/web/apache/cgi-bin]$ php test.php
Hello World!

However when I try to execute it through a CGI process, I get the "500 Internal Server Error".

Here is my error log:

[Tue Feb 12 00:57:26 2008] [error] [client 127.0.0.1] C:/web/apache/cgi-bin/test.php is not executable; ensure interpreted scripts have "#!" first line
[Tue Feb 12 00:57:26 2008] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: C:/web/apache/cgi-bin/test.php

I can run a PERL CGI script that resides in the same cgi-bin directory as the test.php.

I have already put a copy of the php.ini in my c:/windows directory.
I put this line in httpd.conf
"Include conf/extra/httpd-php.conf"

and within the httpd-php.conf I have the following content:

PHP 5 as CGI

<Directory "c:/web/php/">
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
ScriptAlias /php5/ "c:/web/php/"
AddHandler application/x-httpd-php5 .php5
Action application/x-httpd-php5 "/php5/php-cgi.exe"

#

PHP 5 as Module

LoadModule php5_module "c:/web/php/php5apache2_2.dll"

<IfModule php5_module>
AddType application/x-httpd-php .php .php3 .php5
AddType application/x-httpd-php-source .phps
PHPIniDir "c:/web/php"
</IfModule>

And now I'm stuck!

Help!

    Just a follow up. I figured out the problem. It was between the chair and keyboard.

    I put the php script in apache/cgi-bin instead of apache/htdocs

    Doesn't get any more basic than that.

      Remember to mark this thread as resolved using the thread tools.

        Write a Reply...