logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Running PHP 5.1.2 as CGI on Apache 2.2 on Windows XP
Author
maestro427



Joined: 04 Feb 2006
Posts: 4

PostPosted: Fri 10 Feb '06 0:11    Post subject: Running PHP 5.1.2 as CGI on Apache 2.2 on Windows XP Reply with quote

Has anyone done this successfully??

I keep getting a 403 Forbidden error saying, "You don't have permission to access /php/php-cgi.exe/phpinfo.php on this server."

I'm using both the Apache 2.2 binary and PHP 5.1.2 mod downloaded from this site. Everything works fine when I load PHP as a module per the instructions given.

However, nothing I have tried gets around the 403 Forbidden error when trying to run it as CGI. I've granted everything total permissions in XP, but still no luck. I've added the following lines to my httpd.conf:

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

Any ideas?? Your help is really needed on this one!

Thanks!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Fri 10 Feb '06 11:50    Post subject: Reply with quote

how Did you call the phpinfo.php

http://127.0.0.1/php/php-cgi.exe/phpinfo.php

or

http://127.0.0.1/phpinfo.php

Did you enable cgi.force_redirect in php.ini ?
Back to top
maestro427



Joined: 04 Feb 2006
Posts: 4

PostPosted: Sun 12 Feb '06 23:53    Post subject: Reply with quote

I called it by the 2nd method:

http://127.0.0.1/phpinfo.php
...with phpinfo.php being located in the root of my htdocs directory.
Also, I do have cgi.force_redirect enabled in php.ini.

Thus, I've since tried calling it by
http://127.0.0.1/php/php-cgi.exe/phpinfo.php
but I get the exact same 403 Forbidden error message.

Any ideas??

Thanks!


Last edited by maestro427 on Sun 12 Feb '06 23:59; edited 1 time in total
Back to top
maestro427



Joined: 04 Feb 2006
Posts: 4

PostPosted: Sun 12 Feb '06 23:55    Post subject: Reply with quote

Oh yeah...my doc root is at C:\Apache2\htdocs\
and my php-cgi.exe is in C:\php\

Any ideas??

Thanks!
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3057
Location: Hilversum, NL, EU

PostPosted: Mon 13 Feb '06 4:10    Post subject: Reply with quote

I tried it also.

When I add the following, it works here:

<Directory "c:/php/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>


Steffen
Back to top
maestro427



Joined: 04 Feb 2006
Posts: 4

PostPosted: Wed 15 Feb '06 0:36    Post subject: Reply with quote

Aha! ...Adding the <Directory>...</Directory> stuff worked!

You're a genius Steffen...genius i tell you. =)

Thanks!
Back to top
axsubram



Joined: 03 Feb 2007
Posts: 1
Location: Chennai, India

PostPosted: Sat 03 Feb '07 9:43    Post subject: It Works! Reply with quote

This is great. Have been tinkering due to this problem for 2 days. Great! Thanks a lot.
Back to top


Reply to topic   Topic: Running PHP 5.1.2 as CGI on Apache 2.2 on Windows XP View previous topic :: View next topic
Post new topic   Forum Index -> Apache