Help - Search - Members - Calendar
Full Version: Can't get PHP to work with Apache 2.2
HTMLHelp Forums > Programming > Web Server Configuration
Technetium
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?
jimlongo
It's far easier to just install WAMP (Windows version of Apache/msyql/php).

There's also MAMP and LAMP extremely easy to install and configure.

I installed MAMP in seconds and it runs flawlessly without any hoops to jump through.

Technetium
I should have updated the post to say that it works now. I'm not sure what happened, but it works now.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.