Can't get PHP to work with Apache 2.2 |
Can't get PHP to work with Apache 2.2 |
Technetium |
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? |
jimlongo |
Mar 18 2011, 10:11 AM
Post
#2
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
|
Technetium |
Mar 18 2011, 12:54 PM
Post
#3
|
Newbie Group: Members Posts: 12 Joined: 16-March 11 Member No.: 14,144 |
I should have updated the post to say that it works now. I'm not sure what happened, but it works now.
|
Lo-Fi Version | Time is now: 25th April 2024 - 01:32 AM |