The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Can't get PHP to work with Apache 2.2
Technetium
post Mar 17 2011, 12:39 PM
Post #1


Newbie
*

Group: Members
Posts: 12
Joined: 16-March 11
Member No.: 14,144



I just installed Apache 2.2 on my laptop which is running Windows Vista. I'm setting this up so that I can work on PHP on my computer without having to put them on the internet for testing. The server works okay in that putting http://localhost correctly goes to the folder I specified in the configuration file, and loads up the index.html found there.

I want to set up PHP, and I downloaded the zip file for VC6 x86 Thread Safe found on php.net. My understanding is that this is the correct file for Apache 2.2. I then did the following:
1. copied contents of zip file to c:\php
2. Opened httpd.conf again from the Apache conf folder
3. added 'LoadModule php5_module "c:/php/php5apache2_2.dll" ' after the existing LoadModule lines
4. added 'AddType application/x-httpd-php .php' after the existing AddType lines
5. added 'PHPIniDir "c:/php" ' to the end of the file
6. I changed the DirectoryIndex line so that it now reads "DirectoryIndex index.php index.html".
7. I created a file called "test.php" that contained only the line "<?php phpinfo(); ?>" and put it in the root folder for my Apache server.
8.I restarted Apache and put "http://localhost/test.php" into the URL.

However, it just showed me the code when it loaded. I also tried running "c:\php\php-cgi test.php" from the command prompt and it returned:
Status: 404 Not Found
X-Powered-By: PHP/5.2.17
Content-type: text\html

There must be something I've missed doing. I copied the instructions I found online for doing this, though. I've double and triple checked for typos in the lines I added to httpd.conf. Any ideas?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 8th June 2024 - 01:49 PM