Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's a tutorial how to do it: <a href="http://www.davidgolding.net/mongodb/installing-mongodb-on-mamp-1-9-5.html" rel="nofollow">http://www.davidgolding.net/mongodb/installing-mongodb-on-mamp-1-9-5.html</a></p> <p>Post was removed so here's the tutorial:</p> <p>Appsolute launched MAMP version 1.9.5 today, so I thought it’d be a great time to add MongoDB to it and improve my NoSQL skills.</p> <ol> <li>Prepare MAMP for MongoDB files</li> </ol> <p>Create a new folder at Applications/MAMP/db/mongo with three additional subfolders named bin, data, and tmp. Provide these folders with chmod 0755 access permissions. These folders will be the main runtime location for Mongo once MAMP gets it running.</p> <ol> <li>Download MongoDB</li> </ol> <p>Grab the latest Mac OS install package of MongoDB. My server setup called for OS X 64-bit, version 1.6.5. It’ll have a directory named bin. Drop the files from this folder into the /Applications/MAMP/db/mongo/bin folder you already created.</p> <ol> <li>Download Mongo Driver for PHP</li> </ol> <p>I’m running PHP 5.3 (why use MongoDB with any earlier version of PHP?), so I’ll need the mongo.so extension to get PHP and Mongo working together. This is available at the MongoDB GitHub repository, under the PHP 5.3 for Mac binary. After unpacking the downloaded file, place the mongo.so extension file in the /Applications/MAMP/bin/php5.3/lib/php/extensions folder.</p> <p>Update: An alternative is to place the mongo.so file in the /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626 folder and avoid having to edit the php.ini file. It appears that MAMP 1.9.5 already has the extension=mongo.so line in the extensions block of the php.ini file, even though version 1.9.5 doesn’t come bundled with Mongo. 4. Create Startup Routines for MAMP</p> <p>Lastly, you’ll need to create the startup routines so that MAMP will launch Mongo along with MySQL and Apache. Create a new file at /Applications/MAMP/bin/startMongo.sh and place in it the following code:</p> <pre><code># /bin/sh /Applications/MAMP/db/mongo/bin/mongod --dbpath /Applications/MAMP/db/mongo/data --logpath /Applications/MAMP/db/mongo/mongodb.log --pidfilepath /Applications/MAMP/db/mongo/tmp/mongo.pid --fork --logappend </code></pre> <p>When called, this script will launch Mongo using the MAMP-relative paths rather than Mongo’s system defaults.</p> <p>Create another file at /Applications/MAMP/bin/stopMongo.sh and place the shutdown method:</p> <pre><code># /bin/sh /bin/kill `cat /Applications/MAMP/db/mongo/tmp/mongo.pid` </code></pre> <p>This works like the previous script, except it kills the mongo.pid process, effectively shutting down Mongo.</p> <p>To have MAMP automatically call these Mongo startup scripts, open the /Applications/MAMP/bin/start.sh and /Applications/MAMP/bin/stop.sh files, and insert the following lines above the startMysql.sh lines, respectively:</p> <p>1 /Applications/MAMP/bin/startMongo.sh</p> <p>1 /Applications/MAMP/bin/stopMongo.sh</p> <p>Now MAMP will automatically launch Mongo upon startup.</p> <p>The only thing left to do is tell PHP to run the mongo.so extension. If you’re running MAMP Pro, edit the php.ini file by selecting File > Edit Template > PHP 5.3 php.ini, otherwise you’ll need to lookup the path the php.ini file from the MAMP startup screen, under “phpInfo” and “Loaded Configuration File.”</p> <p>Insert the following line in the php.ini file/template, save the file, then restart MAMP.</p> <p>1 extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/mongo.so"</p> <p>Mongo should now run in the background on MAMP, which you can connect with from PHP using the main connection routines listed on the PHP site. Welcome to NoSQL on MAMP!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload