views:

123

answers:

2
+1  Q: 

Mongodb and MAMP

I am using MAMP and would like to use mongo with PHP. I am stuck because the version of MAMP I'm using is the latest version I can find, and it's running PHP 5.2.11. The only Mongo PHP install I can find for OSX is for PHP 5.3.

Is there any way to get mongo working with PHP using MAMP?

+2  A: 

Mac OS X 10.6 Snow Leopard (with the newest updates) has PHP 5.3 installed along with Apache.

You can enable the installed Apache in System Preferences, Sharing, Web Sharing (there is a help icon (?) which shows you details on using the system's web server).

See also this StackOverflow question:
Easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard)?

Archimedix
Alternatively, try XAMPP. http://www.apachefriends.org/en/xampp-macosx.html
Archimedix
A: 

Here's the way I did it and it was fairly simple.

First, read what Mongo says @ http://www.mongodb.org/display/DOCS/PHP+Language+Center

When you run sudo pecl install mongo it's going to install it for the standard OSX PHP installation to use, so if for some reason you're using the built-in Apache installation.

Like you, I like using MAMP. I didn't want to go through figuring how to download Mongo into MAMP, so I just creating a symbolic link in the MAMP PHP Extensions folder and put the extension line in the MAMP php.ini. Restarted MAMP Apache and everything worked beautifully!

A couple things to note, after installing Mongo, note the extensions folder it installed it into then check MAMP php.ini to see where it has its extensions set to be. You'll notice the ending is very similar.

Hayden