Permalink
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (83 sloc) 2.67 KB
.. _php-language-center:
==================
MongoDB PHP Driver
==================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: twocols
For the official MongoDB PHP Driver reference, see:
- `MongoDB PHP Library Documentation
<https://docs.mongodb.com/php-library/>`_
- `MongoDB PHP Extension Documentation
<http://php.net/manual/en/set.mongodb.php>`_
Drivers
-------
The currently maintained driver is the `mongodb
<https://pecl.php.net/package/mongodb>`_ extension available from PECL. This
driver can be used stand-alone, although it is very bare-bones. You should
consider using the driver with the complimentary `PHP library
<https://github.com/mongodb/mongo-php-library>`_, which implements a more
full-featured API on top of the bare-bones driver. Further information on this
architecture may be found in the `PHP.net documentation
<http://php.net/manual/en/mongodb.overview.php>`_.
The `mongo <https://pecl.php.net/package/mongo>`_ extension available from PECL
is an older, legacy driver for PHP 5.x. The ``mongo`` extension is no longer
maintained and new projects are advised to use the ``mongodb`` extension and
PHP library. A community-developed `Mongo PHP Adapter
<https://github.com/alcaeus/mongo-php-adapter>`_ project implements the legacy
``mongo`` extension's API using the new ``mongodb`` extension and PHP library,
which may be useful for those wishing to migrate existing applications.
Compatibility
-------------
MongoDB Compatibility
~~~~~~~~~~~~~~~~~~~~~
.. include:: /includes/extracts/php-driver-compatibility-matrix-mongodb.rst
.. include:: /includes/php-mongodb-compatibility-table.rst
.. include:: /includes/extracts/php-driver-compatibility-full-mongodb.rst
Language Compatibility
~~~~~~~~~~~~~~~~~~~~~~
.. include:: /includes/extracts/php-driver-compatibility-matrix-language.rst
.. list-table::
:header-rows: 1
:stub-columns: 1
:class: compatibility-large
* - PHP Driver
- PHP 5.4
- PHP 5.5
- PHP 5.6
- PHP 7.0
- PHP 7.1
- PHP 7.2
* - mongodb-1.5
-
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
* - mongodb-1.4
-
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
* - mongodb-1.3
-
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
.. include:: /includes/extracts/php-driver-compatibility-full-language.rst
.. include:: /includes/unicode-checkmark.rst
See Also
--------
- :ref:`php-libraries-frameworks-and-tools`
.. class:: hidden
.. toctree::
:titlesonly:
/drivers/php-libraries