Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of module?

This is a discussion on Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of module? within the PHP Language forums, part of the PHP Programming Forums category; Hi there, I can´t get PHP 4.3.8 to work with apache 2.0.50 on Windows 2000. ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #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
  #2 (permalink)  
Old 09-22-2004
Simon Stienen
 
Posts: n/a
Default Re: Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of module?

Piet <Piet <pit.grinja@gmx.de>> wrote:
> 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?

Everything in cgi-bin is considered as CGI script and therefore handled as
one. Instead, put your PHP scripts in your normal htdocs, where your static
files are and the scripts should work.

--
Simon Stienen <http://dangerouscat.net> <http://slashlife.de>
»What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done.«
-- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle
Reply With Quote
  #3 (permalink)  
Old 09-22-2004
Piet
 
Posts: n/a
Default Re: Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of module?

Simon Stienen <simon.stienen@news.slashlife.de> wrote in message news:<saav9c7loz38$.dlg@news.dangerouscat.net>...
> Piet <Piet <pit.grinja@gmx.de>> wrote:
> > 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?

> Everything in cgi-bin is considered as CGI script and therefore handled as
> one. Instead, put your PHP scripts in your normal htdocs, where your static
> files are and the scripts should work.

That was the whole mistake...I don´t believe it.
Many thanks
Piet
Reply With Quote
  #4 (permalink)  
Old 10-19-2004
codeman43
 
Posts: n/a
Default Re: Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of

Make sure that the "DocumentRoot" is set to the below setting in your
Apache config, "httpd.conf".

<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>



Reply With Quote
  #5 (permalink)  
Old 10-19-2004
codeman43
 
Posts: n/a
Default Re: Newbie: Apache 2.0.50/Win2K executes PHP 4.3.8 as CGI instead of

Make sure that the "DocumentRoot" is set to the below setting in your
Apache config, "httpd.conf".

<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:35 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0