Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do you determine correct dll for mongo php extension?

Tags:

mongodb

dll

i'm having an issue loading the php extension for mongo. i'm running windows 7 (32bt), with php 5.2. i'm trying to update my php.ini file with the correct dll name, but not sure which of the dll's to use. i know which php file to update.

the two sites i've found are:

https://github.com/stealth35/stealth35.github.com/downloads

https://github.com/mongodb/mongo-php-driver/downloads

of these two sites, which windows (32bt) version am i to use?

any help on this would be much appreciated. thank you.

like image 597
user3067901 Avatar asked Dec 05 '13 03:12

user3067901


People also ask

Can we connect MongoDB with PHP?

MongoDB provides PHP drivers, allowing us to connect and manage a MongoDB instance from code.

What is MongoDB extension?

MongoDB driver ¶ This extension is developed atop the » libmongoc and » libbson libraries. It provides a minimal API for core driver functionality: commands, queries, writes, connection management, and BSON serialization.


1 Answers

I'm going to recommend a 3rd place https://s3.amazonaws.com/drivers.mongodb.org/php/index.html

Now if you look in the latest version: php_mongo-1.4.5.zip (it has older versions there also) you'll see

php_mongo-1.4.5-5.2-vc9-nts.dll
php_mongo-1.4.5-5.2-vc9.dll
php_mongo-1.4.5-5.3-vc9-nts-x86_64.dll
php_mongo-1.4.5-5.3-vc9-nts.dll
php_mongo-1.4.5-5.3-vc9-x86_64.dll
php_mongo-1.4.5-5.3-vc9.dll
php_mongo-1.4.5-5.4-vc9-nts-x86_64.dll
php_mongo-1.4.5-5.4-vc9-nts.dll
php_mongo-1.4.5-5.4-vc9-x86_64.dll
php_mongo-1.4.5-5.4-vc9.dll
php_mongo-1.4.5-5.5-vc11-nts-x86_64.dll
php_mongo-1.4.5-5.5-vc11-nts.dll
php_mongo-1.4.5-5.5-vc11-x86_64.dll
php_mongo-1.4.5-5.5-vc11.dll

x86_64 are the 64 bit versions, since you are running 32 bit windows, you can ignore those, and the number that comes after 1.4.5(the mongo version) is the php version it expects aka 1.4.5-5.3 is php 5.3, mongo 1.4.5, so that narrows down the list to:

php_mongo-1.4.5-5.2-vc9-nts.dll
php_mongo-1.4.5-5.2-vc9.dll

vc9 refers to the visual studio it was compiled with, I believe vs9 is VS2008 ,and nts refers to "Non-Thread Safe" , if you are using threads use the php_mongo-1.4.5-5.2-vc9.dll ,

Place it in the "ext" directory for your php install(or wherever the extensions directory is) then add

extension=php_mongo-1.4.5-5.2-vc9.dll

or extension=php_mongo.dll (if you rename it to php_mongo.dll) to your php.ini

like image 106
gmlime Avatar answered Oct 24 '22 12:10

gmlime