View Single Post

  #1 (permalink)  
Old 09-22-2004
Piet
 
Posts: n/a
Default Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of module?

Hi there,
I can´t get PHP 4.3.8 to work with apache 2.0.50 on Windows 2000.

I followed the instruction that I found on
http://de3.php.net/manual/en/install...ws.apache2.php.
The files php4apache2.dll and php4ts.dll are located in
"C:\Programme\PHP", together with the php.ini.
In the php.ini, I have the entry
==============================
extension_dir = "C:\Programme\PHP".
==============================
In the httpd.conf, I inserted the following entries
==============================
LoadModule php4_module "C:\Programme\PHP\php4apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:\Programme\PHP"
==============================
When I start apache and go to the apache startup page
(http://localhost:8080 in my case), everything is fine. When I insert
the line
http://localhost:8080/cgi-bin/index.php
in the browser, I get an error. In the error log I have the following
entry:

[Sat Sep 18 11:28:52 2004] [error] [client 127.0.0.1]
C:/Programme/Apache/Apache2/cgi-bin/index.php is not executable;
ensure interpreted scripts have "#!" first line
[Sat Sep 18 11:28:52 2004] [error] [client 127.0.0.1] (9)Bad file
descriptor: don't know how to spawn child process:
C:/Programme/Apache/Apache2/cgi-bin/index.php
The index.php looks like this:
==============================
<?php
phpinfo();
?>
==============================

When I change the index.php like that
==============================
#!
<?php
phpinfo();
?>
==============================
I get the following error:

[Sat Sep 18 11:25:13 2004] [error] [client 127.0.0.1] (OS 193)%1 ist
keine zulässige Win32-Anwendung. : couldn't create child process:
720193: index.php
[Sat Sep 18 11:25:13 2004] [error] [client 127.0.0.1] (OS 193)%1 ist
keine zulässige Win32-Anwendung. : couldn't spawn child process:
C:/Programme/Apache/Apache2/cgi-bin/index.php
[Sat Sep 18 11:25:48 2004] [error] [client 127.0.0.1] (OS 193)%1 ist
keine zulässige Win32-Anwendung. : couldn't create child process:
720193: index.php
[Sat Sep 18 11:25:48 2004] [error] [client 127.0.0.1] (OS 193)%1 ist
keine zulässige Win32-Anwendung. : couldn't spawn child process:
C:/Programme/Apache/Apache2/cgi-bin/index.php

Apparently, apache is trying to execute the index.php as a CGI script
with an external interpreter and not as an apache module. I went
through the documentation of both apache and php, but that wasn´t
successful, maybe because I do not know what I am looking for exactly.
I know that the support of apache2 by PHP is experimental, but I
believe that it should at least work?
Are there any more hints about "hidden" parameters to be set to get
the configuration successfully to work? I posted this message already
on php.windows, but this group seems to be very rarely visited.
Many thanks
Reply With Quote