cannot load php5apache2_2.dll - php

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.

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.

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:
;extension=php5apache2_2.dll
// and change y to
extension=php5apache2_2.dll
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.

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:
Created the folder C:\Apache
Downloaded and installed http-2.2.22-win32-x86-no-ssl.msi
During install, entered localhost as Network Domain and Server Name
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:)
Created the folder C:\PHP
Downloaded and installed php-5.2.17-Win32-VC6-86.msi
Created a new file in notepad with the following:
Saved it in the Apache/htdocs folder as phpinfo.php
From browser, typed in url http://127.0.0.1/phpinfo.php
It did not work (i.e. it did not run the .php program file)
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
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
Fixed that by editing this line in the above file to
PHPIniDir "C:/PHP/php.ini"
Tried to restart Apache again, run the test file in the browser.
Still, it did not work:(
Recalled seeing this before and decided to reboot computer
Restarted (or started) the Apache Server
Ran the test file again..
IT WORKED!
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.
http://in3.php.net/manual/en/install.windows.manual.php

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
http://windows.php.net/downloads/releases/php-5.4.38-Win32-VC9-x86.zip

Related

How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1?

I want to downgrade php version from 7.1.1 to 5.6 in xampp 7.1.1. But I can't find any option.
I think the most safest downgrade path from PHP7 to PHP5 in Xampp is:
Download a self-packaged version of Xampp with PHP5 from here (as of today this is xampp-win32-5.6.37-0-VC11.zip).
Rename the php folder to php7 in Xampp.
Now copy the php folder from xampp-win32-5.6.37-0-VC11.zip into your Xampp install folder.
Make a backup from .\xampp\apache\conf\extra\httpd-xampp.conf file.
Replace this file from xampp-win32-5.6.37-0-VC11.zip as well.
This way the config files (including php.ini) has settings from the Xampp team.
Before any changes, to verify changed Apache configs, you can compare both Xampp release folder at .\xampp\apache\conf with tools like Meld.
I should note that please download PHP 5 and 7 Xampp packages released at the same time.
Notify me if I miss something.
If you want to downgrade php from 7.1.1 to 5.6 in xampp follow the steps(For Windows):-
Go to https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/
Download and extract the file xampp-win32-5.6.36-0-VC11.zip see the image
[image 1][1]
Delete php folder and apache folder present in C:\xampp
Copy php folder and apache folder from extracted file and paste it to C:\xampp
Add " C: " before \xampp\ to php ini file present in php folder.
Start your apache and MySQL and check php version. It will show php 5.6.36
Just delete this xampp, and download 5.6 version.
There is no option to downgrade XAMPP. XAMPP is hardcoded with specific PHP version to make sure all the modules are compatible and working properly. However if your project needs PHP 5.6, you can just install a older version of XAMPP with PHP 5.6 packaged into it.
Source: How to downgrade php from 5.5 to 5.3
Change the .htaccess code to switch to PHP 5.6:
AddHandler application/x-httpd-php56 .php
XAMPP is an integrated package and you can not downgrade or change one of its component such as php. (There are some solutions that you can use but there is little chances that everything work fine.)
You can download the package from these links:
https://www.apachefriends.org/download.html
https://sourceforge.net/projects/xampp/files/
You had better to download the old package form sourceforge.net.
You do not have to install another version of Xampp. I've managed to use PHP 5.6 on my Xampp PHP 7 version. Here is what you need to do to make it works:
Raname (backup) <XAMPP_DIR>\php to <XAMPP_DIR>\php~7
Copy (backup) <XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf to <XAMPP_DIR>\apache\conf\extra\httpd-xampp~7.conf
Download PHP5 and unpack it to <XAMPP_DIR>\php
Edit <XAMPP_DIR>\apache\conf\extra\httpd-xampp.conf and change all php5 occurrences to php7. You need to change php7apache2_4.dll to php5apache2_4.dll, php7ts.dll to php5ts.dll and php7_module to php5_module
Ensure all your paths are correct like extension_dir in php.ini.
Restart Apache and voila.
If you want to downgrade php version, just simply edit yout .htaccess file.
Like you want to downgrade any php version to 5.6, just add this into .htaccess file
<FilesMatch "\.(php4|php5|php7|php3|php2|php|phtml)$">
etHandler application/x-lsphp56
</FilesMatch>
I know it might be late but I'm just adding to Lanti's answer since it's the most popular, I had the same problem as Wouter Vanherck in the comments and I can't comment yet.
What helped for me was instead of just replacing \xampp\apache\conf\extra\httpd-xampp.conf I replaced the whole apache folder. I basically did the same thing with it as with the php folder (steps 2 and 3).
Now the error is fixed and Apache starts just fine.
Using WAMP is perforce option if we want to use more then one version of php.
It is very easy to do, all you need to do is
1) download 5.6 from [1]: https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.36/, the run the setup and install in folder "xampp"
2) download 7.6 from [https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/7.4.2/xampp-portable-windows-x64-7.4.2-0-VC15-installer.exe/download][1] and run the setup in "xampp2"
NOte: after that you now have separate xampp installed in your system. all you do now is to run each xampp as a separate entity. Alway quite the 5.6 if you want to run 7.6
This solution is Only for local system / localhost on windows:
The simplest way to install xampp 5.6.X version as per your requirement in other windows drive then run xampp 5.6.X services from it's control panel for php 5.6 version.
NOTE: If you already have xampp (any other version) on your system then please close that xampp's services then start xampp 5.6.x services otherwise this solution will not work.
You can download your required (xampp 5.6 as per question) xampp version from below link:
https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/
I have used this solution many times, it worked like charm. I hope this will also help you. Thank you to ask this question.
i was trying the same, so i downloaded the .7zip version of XAMPP with php 5.6.33 from
https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/5.6.33/
then followed the steps below:
1. rename c:\xampp\php to c:\xampp\php7
2. raname C:\xampp\apache\conf\extra\httpd-xampp.conf to httpd-xampp7.OLD
3. copy php folder from XAMPP_5.6 7zip archive to c:\xampp\
4. copy file httpd-xampp.conf from XAMPP_5.6 7zip archive to C:\xampp\apache\conf\extra\
open xampp control panel and start Apache and then visit ( i am using port 82 instead of default 80)
http://localhost
and then click PHPInfo to see if it is working as expected.
Opening localhost shows dashboard
Opening phpinfo shows version 5.6

Php Curl not working After Upgrade to x64. Its enabled in php.ini [duplicate]

I got my WAMP installed on my windows 7 64bit. cURL is not working, but still I got it enabled from the WAMP tray.
I have also uncommented extension=php_curl.dll in php.ini for both the PHP and Apache folder.
Windows give me an error message,
PHP Startup: unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_curl.dll' - the application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-lin sxstrace.exe tool for more detail."
How can I fix this problem?
Go to http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and download the cURL version that corresponds to your PHP version under "Fixed curl extensions:".
So if you have PHP 5.3.13, download "php_curl-5.3.13-VC9-x64.zip". Try the "VC" version first. Then replace the php_curl.dll in ext folder. This worked for me.
I had the same exact issue. After trying almost everything and digging on Stack Overflow, I finally found the reason. Try downloading "fixed curl extension" separately from PHP 5.4.3 and PHP 5.3.13 x64 (64 bit) for Windows.
I've downloaded "php_curl-5.4.3-VC9-x64", and it worked for me. I hope it helps.
Works for me:
Go to this link
Download *php_curl-5.4.3-VC9-x64.zip* under "Fixed curl extensions:"
Replace the php_curl.dll file in the ext folder.
This worked for me.
I have struggled a lot with this myself.. In the end, PHP version 5.3.1 with Apache 2.2.9 worked...
I was getting the consistent error of missing php5.dll. For this, I renamed all the old php.ini files which are not required (outside of the WAMP folder) to old_ohp.ini.
The error is unrelated to PHP. It means you are somehow relying on Apache's mod_deflate, but that Apache module is not loaded. Try enabling mod_deflate in httpd.conf or commenting out the offending line (search for DEFLATE in httpd.conf).
As for the PHP curl extension, you must make sure it's activated in php.ini. Make sure extension_diris set to the directory php_curl.dll is in:
extension_dir = "C:/whatever"
and then add
extension=php_curl.dll
The steps are as follows:
Close WAMP (if running)
Navigate to WAMP\bin\php\<your version of PHP>
Edit file php.ini
Search for curl, uncomment extension=php_curl.dll
Navigate to WAMP\bin\Apache\<your version of Apache>\bin\
Edit file php.ini
Search for curl, uncomment extension=php_curl.dll
Save both
Restart WAMP
I think cURL doesn't work with WAMP 2.2e. I tried all your solutions, but it still did not work. I got the previous version, (2.2d) and it works.
So just download the previous version :D
Well, just uninstall WAMP 64-bit and go with the 32-bit version. It worked in my case.
This is how I've managed to load CURL correctly. In my case php was installed from zip package, so I had to add php directory to PATH environment variable.
Ensure that your system PATH environment variable contains the directory in which PHP is installed.
Stop the Apache server and restart it once more. With luck CURL will start working.
This work for me: http://www.mediafire.com/?3ay381k3cq59cm2
download a paste the file in ext folder
PHP 5.4.3
I had the problem with not working curl on win8 wamp3 php5.6. Reinstalling wamp (x64 version as I had x64 in system info) made it work fine.
uncomment "curl=cainfo" in the php.ini document
This helped me when installing Prestashop when all other methods still did not work.
This is what worked for me
Answered by Soren from another SO thread - CURL for WAMP
"There seems to be a bug somewhere. If you are experiencing this on Win 7 64 bit then try installing apache addon version 2.2.9 and php addon version 5.3.1 and switching to those in WAMP and then activating the CURL extension. That worked for me."

PHP Startup Unable to load dynamic library php_mongo.dll

I'm a beginner for this. I'm trying to install mongodb driver on php.
Platform: Windows 8.1 64bit.
PHP 5.5.9
Apache/2.4.7
Followed the instruction here:http://php.net/manual/en/mongo.installation.php#mongo.installation.windows
I've tried all php_mongo.dll file with VC11 and put in php/ext folder. and added extension=php_mongo.dll in php.ini file but when I tried to start apache in xampp controller I got an error.
Php Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_mongo.dll' -%1 is not a valid Win32 application.
I've already check my VC compilator version inside phpinfo() and it's stated there MSVC11 with architecture: x86.
it would be nice if someone can help me.
Thanks. appreciate it.
Make sure you download the correct .DLL for your PHP installation. Good chance you're running apache x86, so download an x86 php_mongo.dll. Also if you're running PHP as an Apache module, make sure you pick the thread safe (ts) one and also pick this type of dll that matches the PHP version you're running.
The versions must match or else you will get a php startup error. Find these Mongo DLLs here.
I did this then I got an error libsasl.dll not found. I simply copied the libsasl.dll found in my PHP installation directory to the Apache installation directory (where httpd.exe is found). Then I restarted my Apache and it worked!
For anyone googling this in 2017, the PECL Package has been updated and is now found at http://pecl.php.net/package/mongodb/1.2.9/windows
and use:
extension=php_mongodb.dll
instead of:
extension=php_mongo.dll
Copy C:\xampp\php\libsasl.dll to C:\xampp\apache\bin\, restart Apache and enjoy.
If you are still having problems after doing the above, do try older version drivers instead.
That is what worked for me on for my XAMPP/ PHP 5.5 on windows 8.
Older drivers can be found here: https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
New drivers can be found here: http://pecl.php.net/package/mongo/1.5.5/windows
You may also want to visit : https://serverfault.com/questions/563867/mongodb-unable-to-load-driver-on-php
This is normally because we use 64 Bit supported DLL file 64 Bit system. But the wamp/xampp architecture could be 32 Bit. We need to use based on the wamp/xampp architecture not the windows architecture. So, try to find relevant version of DLL file to the wamp/xampp architecture. The solution in the below link worked like a charm to me,
http://grokbase.com/t/gg/mongodb-user/151xpk3fkr/php-5-6-3-with-mongodb-driver-unable-to-load-dynamic-library-not-a-valid-win32-application
This link helps you to find the wamp/xampp architecture, https://stackoverflow.com/a/22454865/4874281
After doing all the steps as mentioned in previous comments xampp may not be able to load the ".dll" file. Just ensure to add the path of the ".dll" file's folder to the environment variable as a system variable path.
I was facing same issue, then after adding the path of the ".dll" file's folder to the environment variable as a system variable path, it worked. It is then able to find the file.
At the end that was the only step which was stopping xampp to load the ".dll" file, although it was present in that folder. Often people miss this step as it is no where pointed out clearly.
My PHP version is 7.2.3 x86
Go to this website and pick DLL according to php version:
https://pecl.php.net/package/mongodb/1.4.2/windows
And set this in php.ini
extension=mongodb

installing PHP APC extension on windows

I want to install the APC extension for PHP. I've got to this page and I'm a little stuck.
I've downloaded a file from here, which gives me a APC-3.1.9.tgz file.
I've extracted the file. However from the page I've mentioned above, I'm given the impression I need to load a .dll file.
I'm lost and confused, what should I be doing?
OS: Windows Vista
Server: Apache
PHP: 5.3.5
You can download the compiled dll from downloads.php.net.
From http://www.php.net/manual/en/apc.installation.php
A DLL for this PECL extension is currently unavailable. See also the
building on Windows section.
In other words: no easy way on Windows
I downloaded the file from above mentioned http://downloads.php.net/pierre/. The zip contains two folders: "nts" and "ts" (probably "tread safe" and "non thread safe") with php_apc.dll file.
You must put this file in your PHP extensions folder (for exemple c:\wamp\bin\php5.4.1\ext) and edit PHP.ini file to add or uncomment the line:
extension=php_apc.dll
After restarting web service (Apache, IIS, etc.) you can check the PHP configuration with
<?php phpinfo(); ?> to see if "apc" block appeared
Here's hoping people looking for APC for Windows are still checking this post.
I just found APC 3.1.9 for Windows here:
http://dev.freshsite.pl/php-accelerators/apc.html
Confirmed working on Apache 2, PHP 5.3.8, Windows 7 (32-bit).
try this Alternative PHP Cache (APC) 3.1.9 extension
https://code.google.com/p/xampp-php-extensions/downloads/detail?name=php_apc.dll&can=2&q=

mcrypt and IIS - module does not load in PHP

I have Windows 2003 Standard, IIS 6, PHP, MySQL and amy trying to get mcrypt working so I can use phpMyAdmin.
I have uncommended php_mcrypt.dll in php.ini and this file is in my extensions folder (c:\php).
I have downloaded libmcrypt.dll to c:\php, c:\php\ext, c:\windows, c:\windows\system32. I have also found a second version of this file on the next and tried that. After each change I have restarted IIS.
Whatever I try mcrypt does not seem to be loaded when I check php_info();. But there are no errors showing.
Is there another version of php_mcrypt.dll? does anyone have a version of phpMyAdmin that does not need mcrypt? Has anyone experienced this problem / have a solution?
All help will be greatly apprecaited.
Many thanks,
Tim
I had the same problem and found that the version of libmcrypt.dll I had was corrupt and when I downloaded a version from the net it was fine. As you have already done this I doubt this helps?
We had the same issue on W2k3(x64)/IIS6/PHP5.2.17. Copying libmcrypt.dll to %WINDIR%\SysWOW64 and an IISRESET solved the problem.
Make sure your extension_dir in php.ini points to the right path (e.g. c:/php5/ext)
Try restarting windows after each change instead of IIS.
libmcrypt.dll only has to be in c:\windows\system32
To be sure mcrypt is (not) loaded, use phpinfo() to check.
I'm also having difficulty getting mcrypt to load, but above has helped me a lot in getting closer to a solution.
Try starting php from the commandline with php -m. It will show you a list of loaded modules.
I was having a weird issue with Win 2k3 Server + IIS 6 + PHP 5.2.9 + mcrypt as well. As soon as I added the mcrypt (or mhash for that matter) extension, fastcgi just timed out. When I removed those extensions from php.ini I see my phpinfo() page as expected. The really weird part was that I could see the module loaded when I run php -m from the command line.
I grabbed all of the dlls from XAMPP (in the php folder) and stuck them all in my PHP installation folder (C:\Program Files\PHP for me). After making the the change to my php.ini
extension=php_mcrypt.dll
I restarted IIS completely rather than recycling the App Pool and my phpinfo page worked as expected. I am not sure why but fastcgi wasn't able to "see" the libraries in the system32 folder, I had to put them in my php root folder.
Good luck.
In my case, my site gave the error "PHP Warning: mcrypt_decrypt()..."
I use IIS6 - Plesk - PHP 2.5
So, I updated PHP version in Plesk CP to 5.3 and then the error disappeared.
Hope this helps somebody.

Categories