Web Servers on Windows - Apache and PHP on WXP Pro SP2

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Windows > July 2006 > Apache and PHP on WXP Pro SP2





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache and PHP on WXP Pro SP2
Mike Tarttelin

2006-06-26, 1:17 pm

Hi,

I'm a newbie with Apache trying to configure a web server on my local
machine with Apache and PHP.

I have downloaded and installed both (Apache 2.2 and php 5.1.4 (Windows
installer version)) under Windows XP Professional SP2 as per download
instructions. I have edited the Apache config file to work with PHP, as
required, with:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"

When testing Apache using IE 6:

Apache works ok with .htm pages

Apache does NOT work with .php pages. When I try to access .php pages with
Apache - I get error 403 - Forbidden. Seems that Apache is not communicating
with PHP?

I also have IIS 5.1 on the same machine. When testing with IIS, IIS works
with .htm pages AND with .php pages.

When Apache is running, the IIS server is STOPPED. When running with IIS,
the Apache server is STOPPED.

Any ideas with getting Apache to work with PHP? Is there a conflict between
IIS and Apache even with IIS stopped?

Thanks Mike T



Nil

2006-06-26, 1:17 pm

On 26 Jun 2006, "Mike Tarttelin" <mike@tartelin.demon.co.uk> wrote
in news:e7p645$br2$1$8300dec7@news.demon.co.uk:

> Apache does NOT work with .php pages. When I try to access .php
> pages with Apache - I get error 403 - Forbidden. Seems that Apache
> is not communicating with PHP?


Check Windows' system and application logs, and the apache error log
for clues.

> Is there a conflict between IIS and Apache even with IIS stopped?


No, I'm sure that's not the problem.
Mike Tarttelin

2006-06-26, 7:16 pm

Hi again,

The Windows System & Application logs show no entries that are time-related
to the Apache log entries below. The Apache logs show as follows when I
attempt to access firstly one .htm page then 3 .php pages:

Apache access log:

127.0.0.1 - - [26/Jun/2006:20:16:53 +0100] "GET /index.htm HTTP/1.1" 304 -
127.0.0.1 - - [26/Jun/2006:20:16:53 +0100] "GET
/css/TarttelinFamilyStyle.css HTTP/1.1" 304 -
127.0.0.1 - - [26/Jun/2006:20:16:56 +0100] "GET /tarttelinregister.php
HTTP/1.1" 403 239
127.0.0.1 - - [26/Jun/2006:20:24:18 +0100] "GET /tarttelinregister.php
HTTP/1.1" 403 239
127.0.0.1 - - [26/Jun/2006:20:27:41 +0100] "GET /tarttelinregister.php
HTTP/1.1" 403 239

Apache error log:

[Mon Jun 26 20:16:24 2006] [notice] Parent: Created child process 3316
[Mon Jun 26 20:16:24 2006] [notice] Child 3316: Child process is running
[Mon Jun 26 20:16:24 2006] [notice] Child 3316: Acquired the start mutex.
[Mon Jun 26 20:16:24 2006] [notice] Child 3316: Starting 250 worker threads.
[Mon Jun 26 20:16:24 2006] [notice] Child 3316: Starting thread to listen on
port 80.
[Mon Jun 26 20:16:56 2006] [error] [client 127.0.0.1] client denied by
server configuration: C:/PHP/php-cgi.exe
[Mon Jun 26 20:24:18 2006] [error] [client 127.0.0.1] client denied by
server configuration: C:/PHP/php-cgi.exe
[Mon Jun 26 20:27:41 2006] [error] [client 127.0.0.1] client denied by
server configuration: C:/PHP/php-cgi.exe

Does this help?

Thanks

Mike T



"Nil" <rednoise+news@REMOVETHIScomcast.net> wrote in message
news:Xns97EE8D858E1FBnilch1@216.196.97.136...
> On 26 Jun 2006, "Mike Tarttelin" <mike@tartelin.demon.co.uk> wrote
> in news:e7p645$br2$1$8300dec7@news.demon.co.uk:
>
>
> Check Windows' system and application logs, and the apache error log
> for clues.
>
>
> No, I'm sure that's not the problem.



Nil

2006-06-26, 7:16 pm

On 26 Jun 2006, "Mike Tarttelin" <mike@tartelin.demon.co.uk> wrote
in news:e7pd7s$dql$1$8302bc10@news.demon.co.uk:

> Apache error log:
>
> [Mon Jun 26 20:16:24 2006] [notice] Parent: Created child process
> 3316 [Mon Jun 26 20:16:24 2006] [notice] Child 3316: Child process
> is running [Mon Jun 26 20:16:24 2006] [notice] Child 3316:
> Acquired the start mutex. [Mon Jun 26 20:16:24 2006] [notice]
> Child 3316: Starting 250 worker threads. [Mon Jun 26 20:16:24
> 2006] [notice] Child 3316: Starting thread to listen on port 80.
> [Mon Jun 26 20:16:56 2006] [error] [client 127.0.0.1] client
> denied by server configuration: C:/PHP/php-cgi.exe
> [Mon Jun 26 20:24:18 2006] [error] [client 127.0.0.1] client
> denied by server configuration: C:/PHP/php-cgi.exe
> [Mon Jun 26 20:27:41 2006] [error] [client 127.0.0.1] client
> denied by server configuration: C:/PHP/php-cgi.exe
>
> Does this help?


Maybe. I'm no expert, but I do have php 5 working with apache 2.2, but
not as CGI, but rather by an installable module. You can find
instructions on how to set it up that way at:

http://www.apachelounge.com/article.php?sid=9

In your case, do you have the cgi-bin defined and aliased correctly?
Mike Tarttelin

2006-06-30, 7:19 am

Hi,

Thanks for the help, but I still can't get it working. I have the
php-cgi.exe defined and aliased in the Apache config file as per the
instalation instruction as:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"

(is this what you mean by "do you have the cgi-bin defined and aliased
correctly?"?)

I also physically removed (uninstalled) Windows IIS just in case there were
any port or permission issues due to IIS simply being installed - but still
no progess.

I'll try again in another 6 months or so when I've got the majority of my
web site done and dusted, but I'll have to resort to testing on my local
machine using IIS (plus php and MySQL) till then (and hope that the hosting
server will still be ok with Apache rather than IIS).

Once again, many thanks

Mike T

"Nil" <rednoise+news@REMOVETHIScomcast.net> wrote in message
news:Xns97EEA76726917nilch1@216.196.97.136...
> On 26 Jun 2006, "Mike Tarttelin" <mike@tartelin.demon.co.uk> wrote
> in news:e7pd7s$dql$1$8302bc10@news.demon.co.uk:
>
>
> Maybe. I'm no expert, but I do have php 5 working with apache 2.2, but
> not as CGI, but rather by an installable module. You can find
> instructions on how to set it up that way at:
>
> http://www.apachelounge.com/article.php?sid=9
>
> In your case, do you have the cgi-bin defined and aliased correctly?



logos3d.net@gmail.com

2006-07-01, 1:20 pm

Hi,

You can download the file
http://www.apachelounge.com/downloa...ll-php5.1.x.zip
and follow the instructions in the file "Readme First.txt". The file
php5apache2.dll that come with php distribution don=B4t work with
Windows and is necesary the patch.

You must install php like Apache module, not like CGI.
Only erese the following lines from httpd.conf:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"

Visit http://www.apachelounge.com/download for more module binaries for
Win32

Bye

PD: Sorry my English

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com