You can easily install MongoDB on you mac using MacPorts
port install mongodb
Now unzip the downloaded file and copy the mongo.so file to extension folder
/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626
MacPorts
MacPorts distributes build scripts that allow you to easily build packages and their dependencies on your own system. The compilation process can take significant period of time depending on your system’s capabilities and existing dependencies. Issue the following command in the system shell:
/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626
Open php.ini file and copy the following code and restart your web server.
extension=mongo.so
Integration MongoDB in Codeigniter
For CodeIgniter there are a few community-built MongoDB libraries you can use. Since I checked almost all of them, use CodeIgniter MongoDB Active Record. Here's a sample code:
Integration MongoDB in Codeigniter
For CodeIgniter there are a few community-built MongoDB libraries you can use. Since I checked almost all of them, use CodeIgniter MongoDB Active Record. Here's a sample code:
// Load MongoDB library
$this->load->library('mongo_db'); // Query MongoDB: Active document library usage example
$docs = $this->mongo_db->where('age', '33')->get('collection_name_here');
No comments:
Post a Comment