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 -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP 5.1.4 on Apache 2.2.2 - How it works?
Author
Thomas Belser



Joined: 09 May 2006
Posts: 3

PostPosted: Tue 09 May '06 11:51    Post subject: PHP 5.1.4 on Apache 2.2.2 - How it works? Reply with quote

Hi everyone,

yesterday evening i installed the apache_2.2.2-win32-x86-no_ssl on my Windows XP Professional Edition.

I configured the apache with this values and the http-server was running:

Code:
ServerRoot "C:/Server/Apache"

Code:
DocumentRoot "C:/Server/Intranet"

Code:
<Directory "C:/Server/Intranet">

Code:
DirectoryIndex index.html index.htm default.html default.htm index.php


So, than i installed php-5.1.4, the php-cgi.exe version.

I added the following lines (the green marked) into the httpd.conf:


Quote:
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "C:/Server/Apache/cgi-bin/"
ScriptAlias /php/ "c:/server/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"


After this I added the following to the php.ini, which i have found in c:/windows/php.ini:

Quote:

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
doc_root = c:/server/intranet


After this i restarted the Apache-Webserver and created an php-info-file. But when i call this I get only the following error-message:

Quote:
403 You have no permission at /php/php-cgi.exe/info.php


What did i wrong? How can i get it to work? Please help me.


Last edited by Thomas Belser on Tue 09 May '06 20:08; edited 1 time in total
Back to top
Thomas Belser



Joined: 09 May 2006
Posts: 3

PostPosted: Tue 09 May '06 15:34    Post subject: Reply with quote

This is the error-message:

Quote:

Forbidden
You don't have permission to access /php/php-cgi.exe/info.php on this server.


How can i fix this problem???
Back to top
Steffen
Moderator


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

PostPosted: Tue 09 May '06 19:32    Post subject: Reply with quote

Do you have any reasons to run php as CGI and not as module ?

Do not set doc_root = in the php.ini

Try to set:

cgi.force_redirect = 0

In which directory you have your php-info script ?

Steffen
Back to top
Thomas Belser



Joined: 09 May 2006
Posts: 3

PostPosted: Tue 09 May '06 20:02    Post subject: Reply with quote

Steffen wrote:
Do you have any reasons to run php as CGI and not as module ?


How can i run php as a module?

Quote:
cgi.force_redirect = 0


Doesnt work. Sad

Quote:
In which directory you have your php-info script ?


Its in the htdocs-folder which i have configured in the httpd.conf as DocumentRoot:

C:/Server/intranet/info.php
Back to top
Steffen
Moderator


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

PostPosted: Tue 09 May '06 20:11    Post subject: Reply with quote

As module: download php5apache2.dll-php5.1.x.zip from www.apachelounge.com/download and follow the instructions in the readme. And do not forget to revert the changes you made in the ini and conf files.

When you still want to run as CGI, try to put your phpinfo.php script in C:/Server/Apache/cgi-bin/ and run http://..../cgi-bin/phpinfo.php .


Steffen
Back to top


Reply to topic   Topic: PHP 5.1.4 on Apache 2.2.2 - How it works? View previous topic :: View next topic
Post new topic   Forum Index -> Other Software