How To Install The Mongodb Extension In Mamp For Mac
Open your .bashrc
or .zshrc
file and add:
The version number here should correspond to the version you're using in MAMP. Corsair link usb driver for mac download.
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.
R/PHP: Ask questions about frameworks, try your hand at php golf and strike gold or simply show off your latest work.
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
MongoDB is an open source, cross platform document-oriented database management system. It is a NoSQL database which stores data and schemas as JSON objects. Mongodb is developed by Mongodb Inc and is published under GNU affero General Public License and Apache.
This tutorial describes the steps involved in the installation of MongoDB on MacOS
Prerequisites
- MacOS
- Login as an administrator on terminal.
- Homebrew must be installed on the system.
Installation
Following steps are used to install MongoDB on MacOS.
1) Update homebrew installer package
To get started with the installation of MongoDB on MacOS, we need to update the repository index of Homebrew package Installer. This will be done with the following command.
2) Install MongoDB
After updating the repository index, we need to install MongoDB which will be done with the help of homebrew installer. It simply installs the MongoDB on location /usr/local/Cellar/mongodb
3) Start MongoDB
To start MongoDB, we need to run the following command.
4) Working on command line
The MongoDB shell can be accessed by running the file named as mongo which is a executable script located inside the bin folder under installation directory.
To create database, we use following command on the MongoDB shell.
5) Stop database
To stop database, we have to specify unload option with the launchctl command as follows:
Well, we have installed MongoDB version 3.4.9 successfully on our MacOS.