Installing PHP with Apache 2.2 under Windows |
Installing PHP with Apache 2.2 under Windows |
Dr Z |
Mar 8 2007, 10:51 PM
Post
#1
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
I have Apache 2.2 running under Windows in my new (well, relatively) laptop. Now, I am in the process of installing PHP 5, as an Apache module. for same reason: Off-line testing.
The most puzzling part is this: I had installed Apache 2, PHP 5, MySQL, and even Pearl, in my PC about 2+ years ago (with some help from the old timers of this board, at times) and tested them. Now I am looking at both computers side by side and comparing the files in each directory. config files, etc.), and I cannot find a difference. I even run a "configuration test" of the Apache 'httpd.conf file' in my PC, as a sanity check, and did not encounter any error messages. The only difference is my PC has Apache 2 installed and the laptop has Apache 2.2. I would appreciate any comments and/or pointers as to what I am doing wrong..... This post has been edited by Dr Z: Mar 8 2007, 10:53 PM |
Effovex |
Mar 9 2007, 12:36 AM
Post
#2
|
Serious Coder Group: Members Posts: 251 Joined: 6-January 07 From: Sherbrooke, Qc, Canada Member No.: 1,477 |
Last I tried installing PHP on Windows the install instructions were full of mistakes. I had similar problems the time before that as well, and those two attemps were separated by one or two years, so I'm guessing they don't care much about Windows users.
Googling gave me a site which has very detailed instructions on installing PHP5 and Apache2 on Windows, hopefully it'll help. |
John Pozadzides |
Mar 9 2007, 02:38 PM
Post
#3
|
WDG Founder Group: Root Admin Posts: 529 Joined: 3-August 06 From: Magnolia, TX Member No.: 2 |
Effovex,
Thanks for finding that site. I just spend a couple of hours going through it, and I'm now running Apache and MySQL on my PC. :-) Now I'll actually be able to test things at home before loading them to the live environment. John |
JamieHarrop |
Mar 9 2007, 03:02 PM
Post
#4
|
Advanced Member Group: WDG Moderators Posts: 129 Joined: 25-October 06 From: West Yorkshire, UK Member No.: 570 |
I've been using PHP Dev for a number of years for my offline testing. It comes complete with Apache, PHP and MySQL, and it installs it all for you.
|
Dr Z |
Mar 12 2007, 11:05 PM
Post
#5
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
Googling gave me a site which has very detailed instructions on installing PHP5 and Apache2 on Windows, hopefully it'll help. I spent my Sunday chasing my tail. First I tried the method suggested by this site... No luck! Then I found this site. A completely different approach, but it made sense. I followed their instructions, with the exception that I am using php5apache2_2.dll included in the zip file for PHP 5.2. Net result is same. When I call up the test fille (test.php), I get 404 - page not found. I appears that the .php extension not recognized? Any suggestions or quesses as to where the goof my lie? |
Dr Z |
Mar 13 2007, 06:49 PM
Post
#6
|
Advanced Member Group: Members Posts: 221 Joined: 23-August 06 Member No.: 11 |
I found the cause! If anybody is using, or intend to use vhosts, the following story may be of interest:
I started with the question "Why 404?", and did some nosing around and found the cause. I was barking at the wrong tree! The cause is not PHP, but it is actually due to Apache and vhosts. Let me explain: I use vhosts for each site and do not use the main htdocs directory of Apache. I had put the test.php file in the main htdocs directory, and was trying to call it up by httpd://localhost/test.php, Then getting the "404 Not Found" message. But now comes the surprise: I made sure that there was no index file in the main htdocs directory, and called up httpd://localhost. Instead of getting the directory listing, I got the index page of the first registered vhost (in the order the vhosts were entered in to the httpd.conf file.) I moved the test.php file to one of the vhosts, and everything is fine. Solved one problem, uncovered another! And, I have no explanation to offer...... |
Lo-Fi Version | Time is now: 25th September 2024 - 03:50 AM |