Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing Mongo PHP extension for MAMP on Mac OS X

Open your .bashrc or .zshrc file and add:

# Mamp PHP Path
export PATH=/Applications/MAMP/bin/php/php5.6.10/bin:$PATH

The version number here should correspond to the version you're using in MAMP.

Next, open /Applications/MAMP/bin/php/php5.6.10 and add a folder called include and within that a folder called php

Next, you'll need to download the PHP components for php 5.6.10 (or whatever version you're using). You can (hopefully) find this at:

Copy the contents of this into the php folder you just created.

In your console, navigate to /Applications/MAMP/bin/php/php5.6.10/include/php and run ./configure. This will compile all the PHP libraries you need.

In your console, navigate to /Applications/MAMP/bin/php/php5.6.10/bin and run sudo pecl install mongo

If this command is successful, last step is to enable Mongo in PHP. Open your php.ini file (probably through the UI in MAMP), extension=mongo.so

@niksumeiko

This comment has been minimized.

Copy link

@niksumeiko niksumeiko commented Dec 29, 2015

You're missing a link to the components mentioned !

@dadixon

This comment has been minimized.

Copy link

@dadixon dadixon commented Dec 29, 2015

how to do you install mongodb.so in MAMP since MongoClient is deprecated now. Works in Linux but not MAMP.

@nikulinsanya

This comment has been minimized.

Copy link

@nikulinsanya nikulinsanya commented Jan 29, 2016

Where is the link??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.