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

Merge branch 'v1.5'

* v1.5:
  Fix similar issues as PHP-1036 by verifying if we actually have a zval before trying to return it. mongo_rucommand() will throw an exception if its null, so no need to else RETURN_NULL()
  Fixed PHP-1036: Segmentation Fault when querying large collection and the working set is not loaded
latest commit dc2733a56b
Hannes Magnusson bjori authored
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 Include my own headers April 04, 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-1036: Segmentation Fault when querying large collection and… April 15, 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 Fix similar issues as PHP-1036 by verifying if we actually have a zva… April 15, 2014
Octocat-spinner-32 collection.h PHP-972: Implement MongoCollection::parallelCollectionScan(). March 25, 2014
Octocat-spinner-32 command_cursor.c Fix similar issues as PHP-1036 by verifying if we actually have a zva… April 15, 2014
Octocat-spinner-32 command_cursor.h PHP-972: Implement MongoCollection::parallelCollectionScan(). March 25, 2014
Octocat-spinner-32 config-w32.h Fixed PHP-831 and PHP-832: Add support for SASL authentication (Kerbe… June 17, 2013
Octocat-spinner-32 config.m4 BUMP 1.5.0RC2 April 01, 2014
Octocat-spinner-32 config.w32 We do need to link these too April 04, 2014
Octocat-spinner-32 cursor.c PHP-1056: Limit legacy projection argument handling to numeric arrays April 08, 2014
Octocat-spinner-32 cursor.h Using MongoDB, Inc. And 2014. March 12, 2014
Octocat-spinner-32 cursor_shared.c Move handle_error into shared_cursor so the command cursor can use it… April 03, 2014
Octocat-spinner-32 cursor_shared.h Move handle_error into shared_cursor so the command cursor can use it… April 03, 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 Fix grammar in auth mechanism error messages March 31, 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 BUMP 1.5.0 April 04, 2014
Octocat-spinner-32 php_mongo.c PHP-1030: Default GridFS chunk size default to 255K (from 256K) March 25, 2014
Octocat-spinner-32 php_mongo.h Back to dev (master) April 04, 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.