Re: apache php cgi install problem



Joseph S. wrote:

Hi,
I am trying to install PHP 5.0.4 on Apache 2.0.54 on WinXP Pro SP2 as a
cgi binary.

Apache2 directory is c:/Apache2
htdocs is c:/Apache2/htdocs

php is installed in c:/php
This contains php.ini, php-cgi.exe and php5ts.dll and other files
required for the module method of php installation are also present,
but i think additional files being present should not cause any problem

Directory containing php scripts is C:/Apache2/htdocs/php

My httpd.conf file has

#----------------------------------------------------------
ScriptAlias /php/ "C:/Apache2/htdocs/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "C:/php/php-cgi.exe"
#ScriptAliasMatch ^/php(.*) C:/Apache2/htdocs/php$1
#----------------------------------------------------------

I get the error
[Wed Feb 22 15:01:18 2006] [error] [client 127.0.0.1]
C:/Apache2/htdocs/php/index.php is not executable; ensure interpreted
scripts have "#!" first line
[Wed Feb 22 15:01:18 2006] [error] [client 127.0.0.1] (9)Bad file
descriptor: don't know how to spawn child process:
C:/Apache2/htdocs/php/index.php

in the Apache error log.

What could be the error?

I have no experience in CGI - I only know it stands for Common Gateway
Interface - is there something needed to be read up first?

I assume when run in CGI mode, whatever you put in your "cgi" diectory
(here it is c:/Apache2/htdocs/php) it will be treated as a script.
Because if I try http://localhost/php/file.htm it still gives the same
error.

Also, if I put #! on the first line I get
[Wed Feb 22 15:33:45 2006] [error] [client 127.0.0.1] (OS 2)The system
cannot find the file specified. : couldn't create child process:
720002: index.php
[Wed Feb 22 15:33:45 2006] [error] [client 127.0.0.1] (OS 2)The system
cannot find the file specified. : couldn't spawn child process:
C:/Apache2/htdocs/php/index.php
or
[Wed Feb 22 15:36:18 2006] [error] [client 127.0.0.1] (OS 193)%1 is not
a valid Win32 application. : couldn't create child process: 720193:
index.php
[Wed Feb 22 15:36:18 2006] [error] [client 127.0.0.1] (OS 193)%1 is not
a valid Win32 application. : couldn't spawn child process:
C:/Apache2/htdocs/php/index.php

Any suggested readings?
I've googled the web and Google Groups but not able to get anything
newer than what i know so far.

TIA,
JS.


Hi,

Well, I don't use XP, but did you read this?

http://nl2.php.net/manual/en/install.windows.apache2.php

Regards,
Erwin Moller
.



Relevant Pages

  • apache php cgi install problem
    ... php is installed in c:/php ... descriptor: don't know how to spawn child process: ... in the Apache error log. ... I have no experience in CGI - I only know it stands for Common Gateway ...
    (comp.lang.php)
  • Re: PHP is looking for php.ini file in c:windows
    ... I'm not using the CGI ... SetEnv in httpd.conf won't have any effect on PHP as an Apache module, ... SetEnv in httpd.conf only affects subprocesses spawned by Apache - i.e. CGI. ...
    (comp.lang.php)
  • Re: HTML proxying in ASP.NET?
    ... web proxies out there for Apache, and written in PHP, or CGI. ... not found an example of a simple web proxy for IIS written in ASP.NET. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Database Security Issues
    ... > Could you elaborate on how you'd do this on an ISP's web server ... With apache it seem that suexec is the way to go (and thus introducing ... new problems like running php as cgi, but the enhanced per user security ...
    (comp.lang.php)
  • Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of module?
    ... I can´t get PHP 4.3.8 to work with apache 2.0.50 on Windows 2000. ... descriptor: don't know how to spawn child process: ... keine zulässige Win32-Anwendung. ...
    (comp.lang.php)