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?
Ehtesham
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.
HI,
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?
@Rajaneesh,
You mean PHP 5.3, right?
I suppose you’ve installed the non thread safe version. Get the other one.
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
@jon,
I don’t think that would work with Apache 2.0.064.
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?!
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.
I have learned that te VC9 installer for windows does not install “php5apache2_2.dll”
VC6 does.
@Edwin Kennedy: yes! it worked for me too. Thanks for sharing, Edwin.
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.
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.
Regards.
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.
@Daniel
Please login as the administrator to edit the config file.
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?
@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.
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.
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?
@Himanshu,
You need to add that line in the LoadModule section. It won’t be there by default.
@Gerardo
Please refer – http://www.webdevelopersnotes.com/blog/apache-error-forbidden-you-dont-have-permission-to-access-on-this-server/