Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Officially supported PHP driver for MongoDB
PHP C Other

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.travis.scripts
api
batch
exceptions
gridfs
mcon
old-tests
php/Mongo
tests
types
util
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE.md
Makefile.frag
Makefile.servers
README.md
bson.c
bson.h
cleantests.sh
collection.c
collection.h
command_cursor.c
command_cursor.h
config-w32.h
config.m4
config.w32
cursor.c
cursor.h
cursor_shared.c
cursor_shared.h
db.c
db.h
io_stream.c
io_stream.h
log_stream.c
log_stream.h
mongo.c
mongo.h
mongoclient.c
mongoclient.h
package.xml
php_mongo.c
php_mongo.h
rebuild.sh

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

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.