简体   繁体   中英

how to add mongodb.so extension for mamp pro?

I follow the following steps:

  1. install mamp pro from MAMP Website

  2. git clone mongodb driver from github

    git clone https://github.com/mongodb/mongo-php-driver.git cd mongo-php-driver git submodule update --init /Applications/MAMP/bin/php/php5.6.10/bin/phpize ./configure --with-php-config=/Applications/MAMP/bin/php/php5.6.10/bin/php-config make all sudo make install

  3. open mamp pro -> file -> Edit Template -> php, add extension=mongodb.so .

  4. restart mamp pro. click web start, click phpinfo, search mongo . none!!

can somebody help me figure out why mongodb.so not working?

try this, it's working

1, goto [php official site][1] download php.5.6.x
2,unpack the file, paste it to /Applications/MAMP/bin/php/php5.6.x/inclue/, you need mkdir and remaned to dirname php
3, drag ../include/php folder to terminal screen, and run:   ./configure
4, run:  sudo /Applications/MAMP/bin/php/php5.6.x/bin/pecl install mongo  or mongodb
5, go to mamp pro->file->php template->php5.6.x.ini, paste ,just like 

extension=/usr/local/Cellar/php56/5.6.22/lib/php/extensions/no-debug-non-zts-20131226/mongo.so

extension=/usr/local/Cellar/php56/5.6.22/lib/php/extensions/no-debug-non-zts-20131226/mongodb.so

6, restart mamp pro -> webstart page-> phpinfo -> search mongo yeah, have them, enjoy it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM