There are 2 parts to this article:
1. Installing mongoDB Server
2. Installing PHP mongo extension and make it work!
Part 1: Installing mongoDB Server on CentOS 6.3
Create mongoDB repository configuration:
cd /etc/yum/repos.d vi /etc/yum.repos.d/10gen.repo
Write the following script to create the mongoDB repository configuration:
[10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0 enabled=1
Save the configuration file and install mongoDB:
yum install mongo-10gen mongo-10gen-server
The configuration file is residing on /etc/mongod.conf, and the start/stop/restart script is /etc/rc.d/init.d/mongod. To start the service:
Make sure the daemon works properly:
chkconfig mongod on
It is running now. This MongoDB instance will store its data files in the /var/lib/mongo and its log files in /var/log/mongo, and run using the mongod user account.
Next step we are going to install PHP mongo extension.