Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing the Mongo PHP Extensions (php_mongo.dll)

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

like image 304
vishal rayabarapu Avatar asked Jul 24 '26 04:07

vishal rayabarapu


2 Answers

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

like image 129
Striezel Avatar answered Jul 26 '26 19:07

Striezel


Should be extension="php_mongodb.dll instead of extension="php_mongo.dll as it is the name of the file you copied.

like image 35
tran quang Avatar answered Jul 26 '26 18:07

tran quang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!