How to install PHP MongoDB driver

Created:

2016-11-16 12:50:47 UTC

Modified:

2017-04-03 10:17:37 UTC

1

Was this article helpful?


Have more questions?

Submit a request

How to install PHP MongoDB driver

Question

How to install PHP MongoDB driver?

Resolution

  1. Install compiler, the PHP Extension and Application Repository (PEAR), and PHP development tools:

    # yum install gcc php-pear php-devel
  2. Execute the following to install a driver:

    # pecl install mongodb
  3. Add the following line to your php.ini file:

    extension=mongodb.so
  4. Check whether the driver is available:

    # php -m | grep mongo
    mongo

Additional information available on official MongoDB web site

Have more questions? Submit a request
Please sign in to leave a comment.