Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Web Server Configuration _ Installing PHP with Apache 2.2 under Windows

Posted by: Dr Z Mar 8 2007, 10:51 PM

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.

When I un-comment the line "LoadModule php_5module php5apache2.dll" in 'httpd.conf file', I get an error message saying that the file 'php5apache2.dll' can not be found.

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.....

Posted by: Effovex Mar 9 2007, 12:36 AM

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 http://www.tanguay.info/wamp/installPhp5.php5, hopefully it'll help.

Posted by: John Pozadzides Mar 9 2007, 02:38 PM

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

Posted by: JamieHarrop Mar 9 2007, 03:02 PM

I've been using http://www.firepages.com.au/ for a number of years for my offline testing. It comes complete with Apache, PHP and MySQL, and it installs it all for you. smile.gif

Posted by: Dr Z Mar 12 2007, 11:05 PM

QUOTE(Effovex @ Mar 8 2007, 09:36 PM) *

Googling gave me a site which has very detailed instructions on http://www.tanguay.info/wamp/installPhp5.php5, 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 http://www.apachelounge.com/forum/viewtopic.php?t=570 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?

Posted by: Dr Z Mar 13 2007, 06:49 PM

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......

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)