Using MongoDB in Python and PHP
MongoDB is a no-relational document database. It main features are high performance and advanced features compared to plain key-value stores.
MongoDB is a no-relational document database. It main features are high performance and advanced features compared to plain key-value stores. It's written in C++ and available on open license. It's being used as a storage for logs, big binary files and for similar cases.
Check if there are mongoDB packages in your distribution repository. If not you can use packages provided by the Mongo team.
MongoDB and PythonFor Python there is mongo-python-driver that covers all database features. You can also check some examples how the module can be used. Here is a simple script (the MongoDB server has to be running):
MongoDB and PHP
For PHP there is a complete binary extension, described on Mongo wiki.
- Get the sources from GIT:
git clone git://github.com/mongodb/mongo-php-driver.git
- From terminal go to the souce code folder and compile/install it:
If you get problems with ./configure and make about to old aclocal headers run aclocal and autoconf first.
phpize ./configure #aclocal #autoconf make make install
- Add to php.ini (/etc/php*/.../php.ini usualy):
extension=mongo.so;After server restart the extension should be visible in the phpinfo.