Home » Php » php – cannot load php5apache2_2.dll

php – cannot load php5apache2_2.dll

Posted by: admin July 12, 2020 Leave a comment


cannot load c:/PHP5/php5apache2_2.dll into server I am getting this error while running apache 2.2 on window XP machine

anyone have any idea what could be the problem. I can see there is no php5apache2_2.dll in c:/php5 folder.

How to&Answers:

First you must downlaod de .dll file (php5apache2_2.dll)
then put it in your extensions directory.

Then edit your php.ini file, find de text:


// and change y to

if the text is not present put the line yourself.
Then restart apache and it should load your extension.

PD: you can see where your extensions directory is located looking
for the text “extension_dir” in your php.ini, sometimes looks like:
extension_dir = C:\php\extensions

Hope this help you, if not please paste the error here, you can find
an error log file in apache/error/error.log or something like that.


What worked for me was obtaining php5apache2_4.dll-php-5.4-win32.zip from
apachelounge and using “php5apache2_4.dll” file from the “PHP 5.4.8” unzipped folder. I had apache 2.3.4 (32-bit) from apachelounge.com and php 5.4.9 (32-bit) from windows.php.net installed on my Win 7 (64-bit).

The dll worked despite 5.4.8 – 5.4.9 mismatch.

The corrsponding changes within “php.ini” and “httpd.conf” are to be maintained acoording to this helpful guide.

Best regards.


You should download the dll file from PHP distribution package. And see three ways to set up PHP to work with Apache 2.x.

You can configure PHP as Apache handler in <[apache_home]>\conf\httpd.conf as follow:

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
#configure the path to php.ini
PHPIniDir 'C:\php\'

NOTE: To avoid the error while starting apache, the php ini dir path should be in single quotes with backslash. Don’t forget to end it with backslash.


Here is how I got it to GO:

  1. Created the folder C:\Apache
  2. Downloaded and installed http-2.2.22-win32-x86-no-ssl.msi
    During install, entered localhost as Network Domain and Server Name
  3. From browser, typed in url http://localhost/ and page came up with “It Works”
    (I do not know if there is a God, but took that as a good sign:)

  4. Created the folder C:\PHP

  5. Downloaded and installed php-5.2.17-Win32-VC6-86.msi
  6. Created a new file in notepad with the following:
  7. Saved it in the Apache/htdocs folder as phpinfo.php
  8. From browser, typed in url
    It did not work (i.e. it did not run the .php program file)

  9. Hmm, oh yeah, you have to restart Apache for it to see updates to its
    own configuration file
    Start, Apache, Control..
    -> generated the error that it could not find C:\Apache\php5apache2_2.dll

  10. Well, I found it in C:\PHP and I copied it to C:\Apache\
    Start, Apache, Control..
    -> generated an error about a problem with the PHPINIDir directive on line 495 of C:/Apache/conf/httpd.conf

  11. Fixed that by editing this line in the above file to

    PHPIniDir "C:/PHP/php.ini"
  12. Tried to restart Apache again, run the test file in the browser.
    Still, it did not work:(

  13. Recalled seeing this before and decided to reboot computer
    Restarted (or started) the Apache Server

  14. Ran the test file again..

Note that in some of the above I may have mixed up some forward and back slashes
Good luck!


You are getting an error due to the fact that the c:/PHP5/php5apache2_2.dll is not shipped with the non-thread safe version of PHP that you probably downloaded. Two options:

  • Download and install the thread safe version of PHP instead and you
    will get everything you need.

  • If the non-thread safe version is important to what you want to accomplish, download the zip bundle of the thread safe version and take only the .dll you need from there.

Which version: For Apache Server 2.2, you need to download PHP 5.4 thread safe, which is shipped with both php5apache2_2.dll and php5apache2_4.dll. Some earlier versions probably work as well. PHP 5.5 is only shipped with php5apache2_4.dll which will mismatch with your version.

Cf the download links here on the official site: http://windows.php.net/download/.


Please check that for using Apache you should download VC6 version of PHP. If you use VC9 Apache will not start. It is clearly given in the site.



For me the problem was resolved by replacing the file php5apache2_2.dll from another site, somehow the file downloaded from the php.net site was corrupt.

I had already the file php5apache2_2.dll on my wamp 2.2 and the PHP version 5.3.13 so I just copied that file into my version 5.4.35 and it worked.

I did not have to mess with the apache configuration as other people suggest.

One more thing I did was to install the Visual C++ Redistributable for Visual Studio 2008 for my x64 machine running Windows 7 Ultimate Edition. I don’t think this helped since I had already the x86 version and working with my previous PHP version, but is part of the action I taken.


None of the suggestions above worked for me. I tried replacing the php5apache2_2.dll file and restarting everything, but got the same error. I ended up uninstalling Apache, MySQL, and PHP, removing the path variables, and then installing WampServer. Had everything up and running in less than 5 minutes.

By the way, I uninstalled PHP by just deleting the folder in Program Files, since it did not turn up in Add/Remove Programs. I also deleted any leftover Apache and MySQL folders after the uninstalls.


Even file exist and apache shows error that this file don’t exists, install Microsoft C++ Redistributable Package. Note, that you have to install 2008 version, then 2010. Install both packages, not only 2010 version.


I’ve had a similar problem. I found out after following a particular Youtube tutorial that if you go and edit the httpd.conf file while Apache is running… it will mess up.
Make sure that you install Apache first… then turn it off, then install php afterward. It should then edit the httpd.conf file itself. This Youtube tutorial solved my problem. http://www.youtube.com/watch?v=UKbEzmMliNM
Hope it helps. I got MySQL installed and working too… but had to install the .Net 4 Framework.


You need to install “http-2.2.22-win32-x86-no-ssl.msi” instead.


I had the same error.
I had installed x64 version of Apache and x86 version of php.
After a lof of searching I found that this doesn’t work.

So I had to install x64 (threadsafe) version of PHP.
After this Apache works fine . 🙂
Hope this helps!


If your php5apache2_4.dll is missing:

My problem was the php5apache2_4.dll was not included in PHP install zip. It is included only the Thread Safe version of PHP 5.4.38