Environment in local system
MAMP 3.2.2
PHP 5.6.24
Webserver Apache
Mongodb for caching is installed successfully and found running in MongoDBservice.
I Downloaded Mongodb drivers from https://pecl.php.net/package/mongodb (used thread safe versions PHP5.6 "php_mongodb.dll") selected php_mongo-1.1.8-5.6-ts-vc11-x64.zip, Made changes to php.ini as extension=php_mongo.dll
I just copied and pasted .dll file in my C:\MAMP\bin\php\php5.6.24\ext
So far good... After restarting my MAMP I cannot see mongo in phpinfo ---->This is my issue
Any idea about this?
Thank you
Just copying the DLL file to the correct directory is not enough. You also need to add the following line to your php.ini file before the MongoDB extension is available:
extension=php_mongo.dll
After that restart Apache and MongoDB should show up as an available extension in phpinfo().
By the way, that is also mentioned on the official PHP website for installing the MongoDB driver: http://www.php.net/manual/en/mongodb.installation.windows.php
Should be extension="php_mongodb.dll instead of extension="php_mongo.dll as it is the name of the file you copied.
In my case, I first downloaded a x64 version of php_mongo.dll, which did not show in phpinfo page. Then i downloaded a x86 version and everything works fine. Hope this helps.
PS. Make sure you pick the right php version.
Related
I am trying to install the Libsodium PHP extension using PECL, but I have no idea how to get the dll files needed. I want to use it with Wampserver on Windows 7 (64-bit).
Can any one help me?
Here is How I did it.
Download the libsodium from here > For PHP 7.0, For PHP 5.6 And For PHP 5.5 (All x64). #One Important Note, Please download appropriate x86-32 bit or x64-64 bit of this extension matching of your environment from here
Extract the Downloaded file and copy libsodium.dll to wamp->bin->php->php5(x).x.xx Folder
Copy php_libsodium.dll From the extracted File to wamp->bin->php->php5(x).x.xx ->ext
Now Click on the WAMP System tray icon.
Go to PHP-> PHP Settings and Click on the enable dl from the menu of the WampManager from the system tray
Now Add bellow line to php.ini from PHP -> php.ini from the menu of Wampmanager, save and close it
extension=php_libsodium.dll
Now Restart Apache or click Restart All Services from the menu of WampManager
You should now get your php_libsodium in the extensions of the php Up and Running.
:)
**I didn't notice that, this question is 4 months old. I hope You have solved this.
use command prompt :
pecl install libsodium
and go to wamp folder find php.ini in php folder :
append this line: to ini file
extension=libsodium.so
You might be able to achieve this result by running php5enmod libsodium, depending on which webserver you use. Make sure you restart your webserver after installing PECL libsodium
here is good references:
https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium
You can download the dll files you need here: http://windows.php.net/downloads/pecl/releases/libsodium/1.0.2/
Select the version that corresponds with your PHP version, compiler and architecture. (this can be checked using phpinfo(); on your machine)
Copy php_libsodium.dll to "ext" directory (C:\PHP\ext)
Copy libsodium.dll to root of PHP directory (C:\PHP)
Add extension=php_libsodium.dll to php.ini
restart apache
This worked on a standalone version of PHP running on Windows 7, I see no reason why this shouldn't work on WAMP or XAMP.
Wamp 3.2.0 64-bit
Even though in the past apparently more steps were required (see my comment from 2018), today I installed Wamp 3.2.0 64-bit, and when I got an error about libsodium not working, I was able to easily fix it by:
Wamp tray icon > PHP > PHP Extensions > ensure "sodium" is checked
(Wamp will automatically refresh)
I was pleasantly surprised that is worked!
You can also use https://github.com/paragonie/sodium_compat. You can simply use :
composer require paragonie/sodium_compat
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
So I've tried almost all the tutorials I've found here and on other sources but the problem is always the same. The extension is not installed when I call the phpinfo method.
I've added the file mongo.so to the extensions folder and I've called it on the php.ini as extension=mongo.so.
I'm using MAMP 2.2 on Mavericks and the php version is 5.5.3.
Appreciate any kind of help.
The output of phpinfo() will tell you which php.ini file (if any) is in use.
You have to modify that php.ini file and add extension=mongo.so and then restart your webserver.
One thing you need to keep in mind when you are installing the MongoDB driver for MAMP is the pecl command you are using is actually the MAMP command, not some alternative PHP install you may have on your system.
To do this, locate the PHP binary distributed with MAMP, and the use the full path to the pecl command of the MAMP installation.
I am trying to install this on a Windows+Apache machine.
Documentation says that SSH2 requires the OpenSSL and libssh2 libraries.
I have added this lines in my php.ini file:
extension=php_openssl.dll
extension=php_ssh2.dll
and restarted Apache but it still not working (Fatal error: Call to undefined function ssh2_connect()).
Can anyone explain me how to install this service?
Here's how I did it:
Downloaded Win32 SSH2 PECL extension from this location
(choose the appropriate version);
Extracted the archive's content and:
placed php_ssh2.dll and php_ssh2.pdb files in the ext folder (e.g. C:\php\ext);
copied libssh2.dll file to C:\Windows\system32 and (if you got Win64) C:\Windows\SysWOW64 folder(s);
Run the following command to register the DLL:
C:\> regsvr32 libssh2.dll
Restarted Apache.
Final note
If you got PHP x64, you have to lookup for the x64 version of the SSH2 library / DLLs.
This site offers some Win64 compiled libraries for PHP, try here first.
Hope this helps.
If anyone is having trouble installing SSH2, here's how I did it:
1) Download SSH2 PECL library from PHP.net [choose the appropriate version].
2) Copy libssh2.dll to System32 [x86] or SysWOW64 [x64] folder.
3) Copy php_ssh2.dll and php_ssh2.pdb to php/ext folder.
4) Remove ';' from the ;extension=php_ssh2.dll line in php.ini. If this line is not on your php.ini, add it.
5) Restart Apache.
Place php_ssh2.dll in ext folder
Place libssh2.dll in php folder
Restart IIS
that work for me
PHP 5.4.25 NTS + Windows Server 2012
If you are running xamp 3.2.1 and PHP 5.6.8, this could be helpful for you.
Do what alex b said, and download the package that corresponds dependindg your php version (and bits) from this page (link)
I've downloaded and replaced in C:\xampp\php\ext and it worked!
Hope this helps, regards.
libssh2 (deps): http://windows.php.net/downloads/php-sdk/deps/
php_ssh2 (ext): http://windows.php.net/downloads/pecl/releases/ssh2/0.12/
Versions prior to 5.5 has already the libssh2.dll (from the second link)
I have wamp with PHP 5.6.25/7.0.10 – MySQL 5.7.14 installed and I cm currently working on PHP 7.0. I had the same error. I checked using phpinfo() if both librarires OpenSSL and libssh2 was working(you can google how to check it). After I could see they was working, I have downloaded php_ssh2.dll at http://pecl.php.net/package/ssh2/1.0/windows (can also be found http://windows.php.net/downloads/pecl/releases/ssh2/ ) for the 7.0 version, put it to php\ext folder. Than I included it in php.ini file using extension=php_ssh2.dll.
Then it appeared at phpinfo(). And it worked. Hope it helps.
Fix that worked for me. Am running xampp v. 3.2.1 apache 2.2 facing the same issue tried placing the dll files at different c: location but failed finally this helped.
1.) Download the version specific dll files from http://pecl.php.net/package/ssh2/0.12/windows and extract the files
Note that even though you are in 64 bit version of windows download the 32 version of THREAD SAFE ssh i.e. Thread Safe (TS) x86 as per your version of php
2.) Add/replace the libssh2.dll at C:\xampp\php (standard installation)
3.) Add/replace the php_ssh2.dll & php_ssh2.pdb within the C:\xampp\php\ext (standard installation)
4.) restart the apache server
Worked Like a charm
CHEERS
First of all, your question reveals two misconceptions:
The Requirements section actually says this:
The » OpenSSL and » libssh2 libraries are required. Ensure that the
development libraries are installed, where a typical package name
might be openssl-dev.
It isn't talking about PHP extensions, it's talking about third-party libraries that have nothing to do with PHP.
extension=php_ssh2.dll requires that you actually have a file called php_ssh2.dll in your PHP's ext directory and you probably don't have it, mainly because it isn't bundled with PHP.
If we check the Installation chapter we can read that SSH2 is a PECL extension. There're a few links with instructions but I can make a summary of the important info:
You need a php_ssh2.dll file that matches your PHP installation.
Neither the PHP team nor the PECL team distribute such file.
Installing PECL extensions on Windows is hard. You need to download the C source code, grab a C compiler and make the file yourself, or find someone who already did it for you.
Said that, unless you Google for php_ssh2.dll and find something relevant, you're probably out of luck.
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