Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Officially supported PHP driver for MongoDB

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .travis.scripts Remove the change to the compile script as we want streams enabled on… June 18, 2013
Octocat-spinner-32 api Fix error codes April 03, 2014
Octocat-spinner-32 batch CID-20535: Dereference null return value (NULL_RETURNS) April 03, 2014
Octocat-spinner-32 contrib PHP-1033: Organize third-party code and license information. March 27, 2014
Octocat-spinner-32 exceptions Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 gridfs PHP-1021 Support maxTimeMS option in MongoCollection::findOne() March 21, 2014
Octocat-spinner-32 mcon Fixed PHP-1075: close() with parallelCollectionScan() segfaults upon … April 22, 2014
Octocat-spinner-32 old-tests Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 php Fixed typos November 05, 2012
Octocat-spinner-32 tests Fixed PHP-1083: 2.6.1-rc0 requires $gt for OplogReplay April 22, 2014
Octocat-spinner-32 types Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 util Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 .gitignore Sort out the includes a bit better and add support for a config.w32.h… April 25, 2013
Octocat-spinner-32 .travis.yml Disable mongos on travis May 01, 2013
Octocat-spinner-32 CONTRIBUTING.md The templates live now in tests/templates/ April 03, 2014
Octocat-spinner-32 LICENSE.md PHP-1033: Organize third-party code and license information. March 27, 2014
Octocat-spinner-32 Makefile.frag coverage/ is a folder September 19, 2012
Octocat-spinner-32 Makefile.servers Enable PHP5.5 and PHP5.4 testing in travis April 02, 2013
Octocat-spinner-32 README.md Mention how to compile enterprise driver April 03, 2014
Octocat-spinner-32 bson.c PHP-972: Implement MongoCollection::parallelCollectionScan(). March 25, 2014
Octocat-spinner-32 bson.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 cleantests.sh Update cleantests.sh for new test directories April 10, 2013
Octocat-spinner-32 collection.c PHP-1071: Create Index test can segfault April 16, 2014
Octocat-spinner-32 collection.h PHP-972: Implement MongoCollection::parallelCollectionScan(). March 25, 2014
Octocat-spinner-32 command_cursor.c Use php_mongo_cursor_throw() instead of zend_throw_exception() April 22, 2014
Octocat-spinner-32 command_cursor.h PHP-972: Implement MongoCollection::parallelCollectionScan(). March 25, 2014
Octocat-spinner-32 config.m4 BUMP 1.5.0RC2 April 01, 2014
Octocat-spinner-32 config.w32 Add extension dependency on json and openssl April 22, 2014
Octocat-spinner-32 cursor.c Fixed PHP-1075: close() with parallelCollectionScan() segfaults upon … April 22, 2014
Octocat-spinner-32 cursor.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 cursor_shared.c Fixed PHP-1082: CommandCursor segfaults when server is closed April 22, 2014
Octocat-spinner-32 cursor_shared.h Fix build: We don't have a connection here, or that variable anyway April 22, 2014
Octocat-spinner-32 db.c Fix similar issues as PHP-1036 by verifying if we actually have a zva… April 15, 2014
Octocat-spinner-32 db.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 io_stream.c Fixed PHP-1058: Enable Cyrus-SASL on Windows April 22, 2014
Octocat-spinner-32 io_stream.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 log_stream.c Fixed PHP-1049: MongoCollection::aggregateCursor batch size defaults … April 02, 2014
Octocat-spinner-32 log_stream.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 mongo.c Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 mongo.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 mongoclient.c Fix similar issues as PHP-1036 by verifying if we actually have a zva… April 15, 2014
Octocat-spinner-32 mongoclient.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 package.xml Merge remote-tracking branch 'upstream/v1.5' April 22, 2014
Octocat-spinner-32 php_mongo.c Fixed PHP-1058: Enable Cyrus-SASL on Windows April 22, 2014
Octocat-spinner-32 php_mongo.h Merge remote-tracking branch 'upstream/v1.5' April 22, 2014
Octocat-spinner-32 rebuild.sh Add --with-mongo-sasl to rebuild.sh configure params March 31, 2014
README.md

Build Status

Installation

To build and install the driver:

phpize
./configure
make
sudo make install

Then, add the following to your php.ini file:

extension=mongo.so

Enabling enterprise features

To connect to MongoDB Enterprise using SASL (GSSAPI) or LDAP (PLAIN) you need to build the driver against cyrus-sasl2 (external library). This is done by passing --with-mongo-sasl to ./configure, optionally passing in the directory to where cyrus-sasl2 was installed:

phpize
./configure --with-mongo-sasl=/usr/local
make
sudo make install

Installing on Windows

Windows builds are available through http://pecl.php.net/package/mongo.

Builds for older driver versions may be found through https://s3.amazonaws.com/drivers.mongodb.org/php/index.html.

Each driver release includes various builds to support specific versions of PHP and Windows. Select the correct DLL file for your environment, and add the following to your php.ini file (VERSION will vary by environment):

extension=php_mongo-VERSION.dll

If the DLL is not located within the directory specified by the extension_dir INI setting, you may need to specify its full path.

Documentation

See the PHP manual.

Support / Feedback

For issues with, questions about, or feedback for the PHP driver, please look into our support channels. Please do not email any of the PHP driver developers directly with issues or questions—you're more likely to get an answer on the mongodb-user list on Google Groups.

Bugs / Feature Requests

Think you have found a bug? Want to see a new feature in the driver? Please open a case in our issue management tool, JIRA:

  • Create an account and login (https://jira.mongodb.org).
  • Navigate to the PHP project.
  • Click Create Issue - Please provide as much information as possible about the issue type and how to reproduce it.

Bug reports in JIRA for all driver projects, as well as for the MongoDB server project, are public. Please do not add private information to bug reports.

Security Vulnerabilities

If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.

Testing

The tests are not available as part of the PECL package, but they are available on Github.

See CONTRIBUTING.md for how to run and create new tests.

Credits

Jon Moss

  • Came up with the idea and implemented MongoCursor implementing Iterator

Pierre-Alain Joye

  • Helped build the Windows extension and has provided the VC6 builds

Cesar Rodas

  • Created the MongoCursor::info method
  • Implemented GridFS read streaming

William Volkman

  • Made connection code check & handle error status

Derick Rethans

  • Implemented MongoInt32, MongoInt64 and related php.ini options.

Taneli Leppä

  • Provided a patch for PHP-706 to swap out select() for poll().
Something went wrong with that request. Please try again.