I am borrowing the similar thread that wasn't helpfull for me:
php_memcache.dll for PHP 5.3
I setup a server using the latest version of easyPHP for Windows. With it came PHP 5.4. I'm now looking for a memcache.dll file that worked for me before and I get this error
"PHP Startup: memcache: Unable t initialize module.
Module compiled with module API=20090626
PHP compiled with module api=20100525
These options need to match"
Any links to a PHP 5.4 memcache.dll file would be greatly appreciated.
In the mentioned thread they adressed version for 5.3 and pierre, but there I find only an older version of the dll
I found this link and it worked for me:
php_memcache-3.0.8-5.4-ts-vc9-x86.zip
Or you can browse a list of the latest releases here and find an applicable version:
http://windows.php.net/downloads/pecl/releases/memcache/
I found out this:
http://windows.php.net/downloads/pecl/snaps/memcache/3.0.6/
Try the following if the above fails:
https://www.dropbox.com/sh/sjkuotlz2sl1kpc/v7-QZeFxHR
The link is dead try
http://windows.php.net/downloads/pecl/releases/memcache/
You'll find the latest memcache dll release in there. What you need to know before downloading:
-The OS version (32 or 64 bit)
-The PHP Compiler version
-Thread Safe support
The PHP Compiler version and thread safe support can be easily checked using the phpinfo() function
Thanks Kevin Horst, tested and working on my Win7 box !
The solution : just download the statically compiled version hosted on Amazon AWS, and extract.
Here is some output from php -i :
phpinfo()
PHP Version => 5.4.0
System => Windows NT xxxx 6.1 build 7601 (Windows 7 Ultimate Edition Service Pack 1) i586
Build Date => Mar 7 2012 14:17:27
Compiler => MSVC9 (Visual C++ 2008)
Architecture => x86
Configure Command => cscript /nologo configure.js "--enable-cli" "--enable-memcache=shared"
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => C:\Users\xxxx\Downloads\UniServer\usr\local\php\php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20100412
PHP Extension => 20100525
Zend Extension => 220100525
Zend Extension Build => API220100525,TS,VC9
PHP Extension Build => API20100525,TS,VC9
memcache
memcache support => enabled
Active persistent connections => 0
Version => 2.2.5
Revision => $Revision: 319585 $
Any pecl modules that have officially been compiled for windows you find under http://windows.php.net/downloads/pecl/releases/
You need to know what php version you are running ie: 5.3,5.4,5.5 and so on
You need to know if your php version is 32 or 64 ie x86, x64
You need to know if the php version was compiled as thread safe or not ie:ts,nts
All the information you can get from a file with the following content
<?php phpinfo()
and view it from the webserver
or from the command line sending the output to a file with:
php -i > phpinfo.txt
NOTE: from the command line you get the data for php-cli witch most likely was compiled with the same configuration
And note that there is Memcache and Memcached but from the php website only memcache is available
Related
Today I wanted to update my dev machine with new php so i downloaded and set up PHP 7.2.7 x64.
After that I sterted collecting missing modules and everything goes fine till i came to the last one: php_ssh2.dll.
Downloaded latest version 1.1.2 from https://pecl.php.net/package/ssh2
Unfortunately it doesn't work. Error:
Warning: PHP Startup: ssh2: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match
Anyone have any tips for me how to make it work?
I have compiled SSH2 module for PHP 7.2 (and PHP 7.3) on Windows. It is available at https://github.com/nufue/pecl-ssh2-windows
On Windows, PHP 7.2.x is built using VC15 and the latest SSH2 module is v1.1.2 which was built on VC14.
So you need to either downgrade to PHP 7.1.x or wait for the PHP team to compile SSH2 in VC15.
Additionally, I have no experience with this but you could decide to compile it yourself in VC15 if you are comfortable with that sort of thing.
Update:
SSH 1.1.2 now has a VC15 build at https://windows.php.net/downloads/pecl/releases/ssh2/1.1.2/
The latest SSH is 1.2 which currently has PHP 7.1-7.4 builds: https://windows.php.net/downloads/pecl/releases/ssh2/1.2/
I am trying to install mongo in php 5.6.0 using MAMP 3.0.
I have correctly downloaded the mongo library and added it to my php.ini.
extension=php_mongo-1.5.7-5.6-vc11.dll
When I run php from the command line, I receive the following (mongo works):
C:\MAMP\bin\php\php5.6.0>php -c ..\..\..\conf\php5.6.0\php.ini -i | findstr /R /C:"mongo"
mongo
mongo.allow_empty_keys => 0 => 0
mongo.chunk_size => 261120 => 261120
mongo.cmd => $ => $
mongo.default_host => localhost => localhost
mongo.default_port => 27017 => 27017
mongo.is_master_interval => 15 => 15
mongo.long_as_object => 0 => 0
mongo.native_long => 0 => 0
mongo.ping_interval => 5 => 5
However, when I start MAMP with errors_on, I receive the following:
PHP startup: Unable to load dynamic library
'C:\MAMP\bin\php\php5.6.0\ext\php_mongo-1.5.7-5.6-vc11.dll' - %1 is not a valid Win32 application.
What am I doing wrong?
Under Windows you have to use the thread safe version. Otherwise the module can't be loaded. You should have a look at the PHP-Version in your case 5.6 of that module and an ts in the filename for your extension.
But i think your problem is that you use a 64bit version. In your package is a file called:
php_mongo-1.5.7-5.6-vc11-x86_64.dll that should work.
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
I finally resolved this by down-revving php and the mongo driver until I could find one that played well together. I'm using php 5.5.12 with mongo driver php_mongo-1.4.5-5.5-vc11.dll.
I don't think this has anything to do with MAMP per se, it's more about getting apache to play with php and mongo.
After struggling a lot with this problem I finally found how to do it:
find on your enviroment the REAL php.ini location used by the system. To do this create a page with phpinfo() and read it on browser, there you find the location of php.ini configuration, in my enviroment was under C:\Windows
open in admin mode the php.ini file and edit it adding, if not exist, the mongo info about extension: i.e. : extension=php_mongodb.dll ensure you type it right (underscore, "mongodb", etc...); than save all.
in the same file look for the extension_dir, the extension directory used by the current php installation. In my enviroment it was C:\MAMP\bin\php\php7.3.19\ext. Now go there and this is the folder where you have to copy past the RIGHT dll
go here https://pecl.php.net/package/mongodb and find the RIGHT version for your enviroment that means you have to know if you are running on x86 or x64 (look on System Info) and if your config usese Thread Safe or not (run on cmd php -i|findstr "Thread"). In my config it was x64 and TS.....NOW this is THE POINT: under that link you will find a lot of versions i.e. 1.12.0 or 1.7.1 and so on, you have to open the sublink and on bottom of page look if the opened one is compatible with your php version (i.e.: 7.3) BUT you have to do anyway some tries with those dll version, in my case I found that the 1.8.0 was compatible with PHP 7.3 I copied it in the ext folder of point 3) BUT nothing worked, so I needed to find a minor version ALWAYS compatible with my PHP 7.3. So for php 7.3 there were at least 3 dll version (1.8, 1.7, 1.6 and so on...) I had success with dll 1.6....SO MAMP needs to find the right one for your system...as soon as I placed the right files in the ext directory and restarted Apache via MAMP interface, the phpinfo spit out the notice that mongo was recognized!!!
So the trick is just try the right dll for PHP version until it match!
I am trying to get php_ssh2.dll working on my IIS 7.5 server.
I have PHP 5.5.4 installed and running (NTS VC11 x64).
I downloaded php_ssh2.dll from here: http://windows.php.net/downloads/pecl/releases/ssh2/0.12/php_ssh2-0.12-5.5-nts-vc11-x64.zip
I placed the extension and the pdb file in the ext folder of my PHP install and enabled it in IIS.
The problem is when I restart IIS, I get the following in my error log:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\5.5.4\ext\php_ssh2.dll' - %1 is not a valid Win32 application. in Unknown on line 0
I also have PHP 5.3 installed with php_ssh2.dll (not the same as linked above) and it works fine.
I do have libssh and openssl installed, as well as Visual C++ 2012 x64.
Is there some other step I'm missing?
Minor update, I tried doing everything above with the x86 builds instead and had the same results. PHP itself runs fine, but I cannot utilize the php_ssh2.dll
It appears the issue is that the 5.5x builds of the php_ssh2.dll lack the libssh2.dll, per this bug report: http://www.phplt.com/2013/09/17/17/php_ssh2-0-12-5-5-nts-vc11-x86-zip-missing-file/
Is this something I can build or acquire elsewhere?
What are you trying to do with php_ssh2.dll? Maybe phpseclib, a pure PHP SSH2 implementation, would work better for you?
I'm trying to load the MongoDb extension for php on a Windows 7 64 bit PC, running XAMPP with Apache 2.0 and PHP 5.3.5, compiler version VC6. I started out with this tutorial, and have also tried the extensions that the php documentation suggested. MongoDb itself is running fine, and shell commands seem to work.
At the moment I have:
Added extension=php_mongo.dll to my php.ini file.
Put the VC6 version of php_mongo.dll (from the following download page, suggested by the PHP documentation) in the php/ext folder.
Restarted my Apache server.
I have also tried php_mongo.dll files form Stealth's github, but they didn't seem to work either.
When restarting Apache, I don't get any errors, but I can't find anything on MongoDb in phpinfo(), and the Mongo class is not recognised either.
Any ideas of what might be wrong? Let me know if you need more info.
The problem might be incorrect version of extension. Try different versions downloaded from here: http://pecl.php.net/package/mongo/1.6.4/windows
Use Bitnami WAMP Stack instead of XAMPP it comes preloaded php_mongo.dll driver installed and no need to configure php.ini file
There is no official MongoDB Driver released for PHP7. So it would be better to download the recommended PHP version 5.5.30(currently) offered by Bitnami Wamp Stack.
There might be two reasons:
First one is as #Sadd suggested. Your mongodb extension should be loaded after what you have done so its very likely that you have enabled extension in wrong file. And yes, there are two such similar files (named php.ini-development and php.ini-production on windows computers), so make sure to enable it in php.ini file and run the following code echo extension_loaded("mongodb") ? "loaded\n" : "not loaded\n"; and you should see loaded on screen.
If you still don't see it, then the second thing you can do is to check whether the version is right or not. You can check your phpinfo() for your php version and then put the right versioned dll file in ext folder. In this, you can have to check whether your php is ts or nts and second one is whether your php is x64 or x86. I hope you are good to go after one or both of the changes.
This was driving my crazy until I looked closely at my PHP version:
$ php -v
PHP 7.4.1 (cli) (built: Dec 17 2019 19:23:59) ( NTS Visual C++ 2017 x64 )
Notice that it says PHP 7.4.1 and NTS and x64? This means that when I download from PECL, I need version 7.4 Non Thread Safe (NTS) x64 or it won't run correctly.
If the correct version of module is not added, an error is thrown.
[PHP Warning: PHP Startup: Unable to load dynamic library 'php_mongodb.dll' (tried: C:\xampp\php\ext\php_mongodb.dll (The specified module could not be found), C:\xampp\php\ext\php_php_mongodb.dll.dll (The specified module could not be found)) in Unknown on line 0]
When downloading the dll extension from https://pecl.php.net/package/mongodb, make sure that NTS (Non Thread Safe) or TS (Thread Safe) is chosen according to what shown from php -v command.
$ php -v
PHP 8.1.7 (cli) (built: Jun 7 2022 21:45:53) (ZTS Visual C++ 2019 x64)
Although here it shows ZTS, TS version can be used in this case.
I have been trying to install mongo for over 6 hours now and still have not gotten it to work. I am going to make this very detailed so that hopefully someone will help me get this working.
My local comp: HP laptop, Windows 7, 64 bit operating system
WAMP 2.2 which includes php 5.3.8 and apache 2.2.21 downloaded from wampserver.com
I have tried installing every combination of mangodb with no success.
I started by downloading the 64 bit download from mongos website. It works fine when I use it from the command line shell but once I install the php_mongo.dll and use it from PHP I get the "mongo not found" error. Also, I checked my php.ini file and mongo is not loading in. I checked the errors and saw "php_mongo.dll is not a win32 application".
I then tried installing a new php_mongo.dll that was vc9 since that is what my php.ini file says. I still get the same problem, it works in when I use it from the command line but not in PHP.
I then deleted all of the mongo files and treid downloaded the 32 bit verson of mongo just to give it a try (my os is 64 bit). Same thing, works in the command line shell but not in PHP. I get the same errors as above.
My php.ini file looks like this:
System Windows NT xxxxx-PC 6.1 build 7601 (Windows 7 Home Premium Edition
Service Pack 1) AMD64
Build Date Sep 16 2011 21:25:01
Compiler MSVC9 (Visual C++ 2008)
Architecture x64
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-
pdo-oci=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_10_2\sdk,shared" "--with-
oci8=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_10_2\sdk,shared" "--with-
oci8-11g=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_11_2\sdk,shared" "--disable-
debug-pack" "--disable-static-analyze"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\wamp\bin\apache\Apache2.2.21\bin\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20090626
PHP Extension 20090626
Zend Extension 220090626
Zend Extension Build API220090626,TS,VC9
PHP Extension Build API20090626,TS,VC9
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, phar
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13,
string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk,
zlib.*
I don't know what I am doing wrong. Again, I have tried every combination of the download and I cannot get a connection from php. Can someone please walk me through the download based on the above information of my system set up or point out what I am doing wrong?
I have tried the basic set up options from mongos site. I have also spent hours of google and from other blogs I know there are some issues with 64 bit comps and there are many other people getting these same errors. I can't seem to find an answer that works or that is detailed enough for a newbie to follow.
Thank you for any help. I just don't know what to do at this point, I've been working on setting up mongo for over 6 hours. Can someone please help?
Ok so after hours and hours of searching for an answer to my original question which was:
I am running a 64 bit machine with a 64 bit wamp stack but mongodb will not work in
wamp 64 bit, how do i get all this working?
I finally just uninstalled wamp 64 bit and downloaded wamp 32 bit onto my windows 64 bit machine. I then downloaded the mongo 64 bit version and everything is working fine.
PHP driver for Mongo DB is not currently working for 64bit wamp (you can keep your OS 64bit).
Basically what you need to do:
install 32 bit WAMP
add PHP mongo driver "php_mongo-1.3.2RC1-5.4-vc9.dll", ts(thread safe) to php ext foldr
download: https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
rename "extension=php_mongo.dll" to "php_mongo.dll" and add extension=php_mongo.dll to php.ini in your server
Solved:
My operating system is 32 bit Windows 7
I did the following to add the mongoDb extension into my php:
1. Used: https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
2. Downloaded: php_mongo-1.5.1.zip and unzip the file which contains the binaries for different PHP versions.
3. Copy php_mongo-1.5.1-5.4-vc9.dll to C:\wamp\bin\php\php5.4.3\ext as php_mongo.dll
4. Added the following line in php.ini
extension=php_mongo.dll
5. Restart my wamp server
Used localhost/?phpinfo=1 to see the installed extension. It works fine.
First I tried php_mongo-1.5.5.zip to do the same but it was not working then successfully configured with php_mongo-1.5.1.zip.
Cheers...