Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Trouble getting php working with Apache. |
|
Author |
|
cnagle
Joined: 28 Jul 2006 Posts: 1 Location: Orlando, FL
|
Posted: Fri 28 Jul '06 1:26 Post subject: Trouble getting php working with Apache. |
|
|
I've installed the following packages:
apache_2.2.2-win32-x86-no-ssl.msi
php5.2-win32-latest.zip
Initially had some trouble with php5.1.4. Apparently the php5apache2.dll didn't have the correct entry points for Apache 2.2.2. That's resolved.
I've made the following changes to httpd.conf:
AddType application/x-httpd-php.php .php
Action application/x-httpd-php "C:/Programs/Apache2.2/php/php-cgi.exe"
LoadModule php5_module bin/php5apache2_2.dll
PHPIniDir "C:/Programs/Apache2.2/bin"
I've copied all the php dlls to "C:/Programs/Apache2.2/bin". I also copied
php.ini-recomended to "C:/Programs/Apache2.2/bin". I then renamed it to php.ini. I made no changes to php.ini.
I followed the instructions I found online to the letter.
When I type in "http://localhost" in IE, it displays the 'It works!" web page. Cool.
I created a php file containing the following script:
<?php phpinfo(); ?>
I placed this script in the following directory:
"C:/Programs/Apache2.2/htdocs"
When I attempt to execute the script via "http://localhost/php_info.php", IE attempts to download the file. Apache is not attempting to execute php-cgi.exe to process the php file.
How can I fix this? Please help... |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Fri 28 Jul '06 2:07 Post subject: |
|
|
I'm not saying that this will solve all your problems, but you are trying to load PHP as CGI and as a module. You have to choose which way you want to run PHP.
I suggest running PHP as a module since there are fewer security risk. I don't know what online post you are talking about, but WOW I hoped they didn't try to setup you like that. Try looking at this post:
http://www.apachelounge.com/viewtopic.php?t=570
While there you will note that I also say that it is not a good idea to run PHP under the Apache root - which it looks like you are.
..
. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 28 Jul '06 9:20 Post subject: |
|
|
Quote: |
AddType application/x-httpd-php.php .php
Action application/x-httpd-php "C:/Programs/Apache2.2/php/php-cgi.exe"
LoadModule php5_module bin/php5apache2_2.dll
PHPIniDir "C:/Programs/Apache2.2/bin"
|
You can not load module and cgi at the same time!
Code: |
PHPIniDir C:/Programs/Apache2.2/bin"
LoadModule php5_module "C:/Programs/Apache2.2/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
|
|
|
Back to top |
|
|
|
|
|
|