WebDevelopersNotes logo

home-icon Home / Answers / Apache cannot load php5apache2_2.dll: file not found!

Apache cannot load php5apache2_2.dll: file not found!

Apache cannot load php5apache2_2.dll: file not found!

When I start the Apache server it’s giving me an error that C:/PHP/php5apache2_2.dll not found. Can you help me with it?

After configuration with Apache, a not-so-uncommon error thrown by Apache is “Cannot load php5apache2_2.dll“. This typically means that the web server is not able to locate the php5apache2_2.dll file. The simple fix is to edit the the Apache configuration file and give it the correct destination for the PHP .dll file.

Sponsored Links

Tips to solve Apache “Cannot load php5apache2_2.dll” error

The first thing is to confirm whether you have the php5apache2_2.dll file in the PHP install directory. I ask you to do this because I had once (accidentally) not unzipped the PHP zip properly.

Assuming you didn’t make the dumb mistake (as I had done… once!), ensure that the file path in the LoadModule line in the Apache configuration file (httpd.conf) has the correct path to the PHP install directory. Thus, if you have installed (unzipped) PHP in C:/PHP the LoadModule line should be:

LoadModule php5_module "c:/PHP/php5apache2_2.dll"

Reboot the computer!

Additionally, other files that are required by PHP should be in the PATH environment variable. Ideally, you should add the PHP install directory to this variable’s value.

One of these tips should solve the ‘Cannot load php5apache2_2.dll’ error message shown by the Apache web server. If not write to me and please explain your problem in detail.

Related articles

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

  • Rajaneesh on March 29th, 2011 11:01 pm

    I installed PHP 3.5 and getting the same problem of Cannot load php5apache2_2.dll.
    I checked the C://PHP folder and found that such file does not exist there. Could you let me know if this file is replaced with newer one in version 3.5?

  • Manish on April 6th, 2011 8:03 pm

    You mean PHP 5.3, right?
    I suppose you’ve installed the non thread safe version. Get the other one.

  • jon on April 8th, 2011 7:23 pm

    Apache 2.0.64
    PHP 5.2

    added :
    LoadModule php5_module “C:/PHP/php5apache2_2.dll”

    I have the php5apache2_2.dll file in the PHP install directory

    reboot it ,and the error when starting the apache:
    –>cannot load C:/PHP/php5apache2_2.dll into server:the specified module could not be found

  • Manish on April 8th, 2011 8:29 pm

    I don’t think that would work with Apache 2.0.064.

  • Ron Danault on June 23rd, 2011 1:07 pm

    First I want to thank you for your detailed instructions on how to install apache and php. I’ve tried many other sites to help me install these programs but I always seem to revert back to yours.
    I’ve successfully installed apache and php many times on different computers. Most of them had Windows XP OS. I just purchased a new HP Pavilion dv7 laptop and I can’t seem to get it to work no matter what I do.
    I’ve installed Apache 2.2.19 and PHP 5.2.17 with no problems, however, as soon as I add the following line of code:
    LoadModule php5_module “c:/PHP/php5apache2_2.dll”
    to the httpd.conf file and try to restart the server I get the following error message:
    “The requested operation has failed!”
    I’ve tried everything I can think of to solve this problem with no success. I’ve tried moving my apache and php folders to different locations. I’ve tried different versions of both apache and php. I’ve tried loading php with installer. You name it, I’ve tried it. And just so you’re aware, I’ve double and triple checked the paths to make sure I didn’t miss type them but that is not the problem.
    Any suggestions?!

  • Edwin Kennedy on June 26th, 2011 1:03 am

    The solution for me in this instance was to get the address of the apache….dll file by right clicking on it and letting Windows give me the answer from its point of view. There must be a symlink in there because the actual location is much different that the nominal location. As in C:PHPphp-5.3.6-Win32-VC9-x86php5apache2_2.dll. I hope this helps someone.

  • Marcel on July 14th, 2011 12:36 pm

    I have learned that te VC9 installer for windows does not install “php5apache2_2.dll”
    VC6 does.

  • Elena on August 2nd, 2011 7:03 pm

    @Edwin Kennedy: yes! it worked for me too. Thanks for sharing, Edwin.

  • Sherry on August 19th, 2011 12:52 am

    Apache was working properly but after installing the PHP 5.2. I have same as what you have done but i get the message as page cannot be displayed. I did restart too.

  • Joseph James on November 13th, 2011 1:12 pm

    First I want to thank you for your detailed instructions on how to install apache and php. I followed your instructions and all seems fine. I test php and it did work, but after sometime it stop working and when when i click phpinfo my it just showing php syntax and not actual output. I checked apache config file did not find any error. Grateful if you help how to solve this problem.

  • Daniel on May 14th, 2012 8:52 pm

    Hi. I have a important query. After editing the Apache config file I was not able to save the file because it says administrative privileges is needed to save. I even tried to replace the original file using the “save as” option. And another fact is, I am the administrator here and why does it ask for administrative rights? Please help.

  • Manish on May 15th, 2012 7:46 am

    Please login as the administrator to edit the config file.

  • Murad Shabanli on June 11th, 2012 7:28 am

    Hello. I did everything as you said. But when I put http://localhost/phpinfo.php in browser it says “Forbidden
    You don’t have permission to access /phpinfo.php on this server.”. Can it be because I have “Denwer” installed on my computer?

  • Manish on June 14th, 2012 7:21 am

    @Murad Shabanli,
    Why did you install Apache and PHP when you already have Denwer? Any case, please refer – Forbidden You don’t have permission to access /phpinfo.php on this server.

  • Himanshu on June 17th, 2012 8:35 am

    I am not able to find php5apache2_2.dll in httpd.conf. The file is available in c drive in PHP folder.
    I cant find
    LoadModule php5_module “c:/PHP/php5apache2_2.dll”

    I am using 32 bit operating system with Window 7, Apache:httpd-2.2.22-win32-x86-no_ssl and PHP:php-5.4.4-Win32-VC9-x86 as you said.

    Please help
    Thanks in advance.

  • Gerardo on June 18th, 2012 2:46 am

    Hi, I just went through the tutorial, and got stuck with one problem.
    I followed the instructions on installing Apache and PHP, and I am pretty sure I did everything as described, and have tripled checked. But when I go to see if PHP is installed right, and do the phpinfo.php script, it says on the browser “Forbidden , you dont have permission to access / on server”. What does this mean, and how do I fix it?

  • Manish on June 20th, 2012 7:03 am

    You need to add that line in the LoadModule section. It won’t be there by default.

Sponsored Links


How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]


The highest-selling computer of all time is Commodore 64. It was introduced in 1982 and sold anywhere between 12.5 to 17 million units. The company was founded by Jack Tramiel, a Polish-American businessman, and was also the first to produce a personal computer available off the shelf, the Commodore PET. unfortunately, the dream run didn't last long and Commodore International filed for bankruptcy on 29th April 1994. [more...]

We use cookies to give you the best possible website experience. By using WebDevelopersNotes.com, you agree to our Privacy Policy