A lot of people have come to grief trying to install PHP with the Apache 2.2 series on Windows. They go to the Apache download page, see that Apache 2.2.3 is described as “the best available version”, and naturally assume that it’s the one they should use. Unfortunately, the Apache dynamic link libraries distributed with the Windows version of PHP (up to and including PHP 5.1.6) support only Apache 2.0 or Apache 1.3.
That’s finally about to change with the release of PHP 5.2.0, which is currently in the release candidate stage. I have been running PHP 5.2.0RC3 for the past few days with Apache 2.2.3, and everything seems to be working smoothly. There are appear to be no conflicts with Dreamweaver 8 or phpMyAdmin 2.8.2.4.
If you already have a testing environment that’s working satisfactorily, I don’t think there’s any point upgrading from Apache 2.0 to Apache 2.2 just to get the latest version. However, if you’re installing Apache for the first time (or on a new machine), it does mean you will soon be able to choose whichever version takes your fancy. The only difference in the configuration is that you need to use php5apache2_2.dll instead of php5apache2.dll. Assuming that you have installed PHP in C:\php5, the appropriate line in httpd.conf looks like this:
LoadModule php5_module C:/php5/php5apache2_2.dll
If you’re absolutely desperate to use Apache 2.2 and PHP 5.2.0, you can download the Windows zip file for PHP 5.2.0RC3 now. The PHP team stopped linking to release candidates on the PHP download site a couple of years ago, but there are plans to resume this practice soon in the interests of getting more people to test them before releasing the final version. There have been a couple of embarrassing cases of a “stable” version needing to be updated after only a couple of days when a small, but vital part of the code was discovered to have introduced a new bug.






Thanks… this helped me solved one of the problems!! I hope that the experts can leave more information about the php or some examples here.. to help the beginner ^_^
Thanks..You have given small but very useful information. But did not answer one question – Does PHP 5.2.0 support Apache 2.0 ?
Yes, the Windows version of PHP 5.2.0 has support for all three series of Apache: 1.3, 2.0, and 2.2. The difference lies in the DLL file used by PHP to communicate with Apache.
Apache 1.3 uses php5apache.dll.
Apache 2.0 uses php5apache2.dll.
Apache 2.2 uses php5apache2_2.dll.
Thanks for giving this much useful information. But I have one problem:
I have downloaded “php-5.2.0.tar.bz2″ and extracted. But where is “php5apache2_2.dll”? In fact there is no dll file anywhere in the whole directory structure.
If you read my original article and reply carefully, you will see that I always refer to the Windows version of PHP 5.2.0. php-5.2.0.tar.bz2 contains the uncompiled PHP source code. If you are installing PHP on Windows, you need to download the Windows binaries for PHP 5.2.0. There are two versions: a zip file, and the Windows installer. Instructions for using the zip file are in my books. Instructions for using the Windows installer are in this tutorial on my main site.
Oh Sorry….
Thank you very much…….
One more question David,
Are there any compatibility issues between PHP 5.1.6 and PHP 5.2.0?
Previously I was using apache 2.0 with php 5.1.6. Now I upgraded php 5.1.6 to php 5.2.0. But I am now getting error like-”PHP Fatal error: Cannot redeclare class DateTime in……”. But this is working fine with php 5.1.6.
As far as I know, there are no compatibility issues between the two versions of PHP. I suspect that you may have created your own DateTime class or are using one created by someone else. However, PHP now has its own DateTime class.
You cannot use the same name as a built-in class. Since it’s impossible to predict what names the PHP development team will pick in future, you should follow the rules and tips laid out in the PHP Userland Naming Guide.
I think David is wrong, he said:
“Yes, the Windows version of PHP 5.2.0 has support for all three series of Apache: 1.3, 2.0, and 2.2. The difference lies in the DLL file used by PHP to communicate with Apache.
Apache 1.3 uses php5apache.dll.
Apache 2.0 uses php5apache2.dll.
Apache 2.2 uses php5apache2_2.dll.”
I mean, I have Apache 2.2.3 & PHP 5.2.0 and i’ve configured Apache and changed the line LoadModule php5module C:/PHP_HOME/php5apache2_2.dll, and still have nothing, just the message (in the Apache Monitor) “The requested operation has failed!”. I don’t know what I’m doing wrong, someone can help me please??? Leave here my e-mail:
edario_ram@hotmail.com
Why do you think I’m wrong? Just because it has failed on your system doesn’t make me wrong. I test things carefully before putting them on my website or in my books, and I have been running PHP 5.2.0 with Apache 2.2.3 successfully for several months.
I have no idea what you have done wrong, but suggest that you start again and use the Windows installer. Before using it, you need to clean up your system by uninstalling Apache and removing the conf folder before reinstalling. Also remove PHP from the Windows path, and make sure that you don’t have a copy of php.ini in the WINDOWS folder.
Having a hellish time with Apache 2.2.3 and PHP 5.2
I can load everything on my machine, have tried with both the info from Dreamweaver 8 and PHP making the changes to the dll file for apache2_2. I have taken everything off and put them on several times but can not get the PHP file to read from the localhost. ( when I call the PHP info file it loads up into dreamweaver instead of opening…HELP!)
Thank u David, I’ve been solved the problem. I have to use the Windows Installer for PHP 5.2.0, I just leave the Apache 2.2.3 and reinstall PHP. But I don’t understand, ’cause I had (previously) Apache 1.5.x or 2.2.0 (i can’t remember well!) and PHP 5.2.0 and I don’t use the Windows Installer for PHP, just extract the files of PHP and configure my Apache and it’s done, but now not, anyway, thank u so much for the help, and I sorry (dumb, I don’t check it the Windows Installer, anyway!!)
David-
I have cleaned both Apache2.23 and PHP5.2 off my system several times. I have reloaded everthing using the new windows installer. Checked and double checked every line of code that I have put into my conf file… APACHE starts on the machine, but when I try my test.php file ( the one that is supposted to give me back the PHP page) all’s I get is it oading up in Dreamweaver and not opening. I don’t have any idea where to go to problemsolve this issue…….and want to work with your book.
thanks….
ok i i have apache 2.2 and the right directives
#BEGIN PHP INSTALLER EDITS – REMOVE ONLY ON UNINSTALL
PHPIniDir “C:\Program Files\PHP”
LoadModule php5_module “C:\Program Files\PHP\php5apache2_2.dll”
#END PHP INSTALLER EDITS – REMOVE ONLY ON UNINSTALL
as it puts in for u, when u install it
ok well when i open the apache console, it says
httpd.exe: Syntax error on line 495 of httpd.conf, cannot load php5apache2_2.dll, one of the library files cannot be loaded
can u help me out….
Much though I would like to help you, it’s difficult to see how I can. Judging from your post, you’re using the Windows installer for PHP. Basically, that should work on most versions of Windows.
However, is you’re using Vista, setting up Apache/PHP/MySQL is nowhere near as straightforward as previous versions. I’m just doing a lot of testing myself, and it’s not as easy as it should be.
hi have install PHP 5.2 and apache 2.2.4 and URL http://localHost Gave me the Page It Works.
But when i made a file hello.php and saved it under c:\php5 but this file unable to get by the server may i get the help.
i have install php 5.2 and apache 2.2. i have configure it as told above.i have browse the url Http://LocalHost and its also working.
But when i have save a file named Hello.PHP it unable to execute can anybody help me with it.
Thanks.