Reputation: 21
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?
Upvotes: 1
Views: 1211
Reputation: 87
After struggling a lot with this problem I finally found how to do it:
So the trick is just try the right dll for PHP version until it match!
Upvotes: 0
Reputation: 21
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.
Upvotes: 1
Reputation: 27295
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
Upvotes: 1