如何为mamp pro添加mongodb.so扩展名?

时间:2016-06-09 07:50:06

标签: php mongodb mamp-pro

我按照以下步骤操作:

  1. MAMP Website

  2. 安装mamp pro
  3. 来自github的git clone mongodb驱动程序

    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 做所有 sudo make install

  4. open mamp pro - >文件 - >编辑模板 - > php,添加 extension=mongodb.so

  5. 重启mamp pro。单击Web开始,单击phpinfo,搜索mongo。 无!!
  6. 有人可以帮我弄清楚为什么mongodb.so不工作?

1 个答案:

答案 0 :(得分:2)

试试这个,它正在运作

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.