Installing the PHP library for MongoDB (PHPLIB)

Once you have installed the low level extension ext/mongodb, the next step is to install the PHP Library for MongoDB (http://php.net/manual/en/mongodb.tutorial.library.php), which we will abbreviate as PHPLIB. Although it is not mandatory to install this library, directly using the classes provided by ext/mongodb would be tedious and require many lines of code. Why not use a library which is expressly designed to leverage ext/mongodb and provides a rich set of classes and functionality which would otherwise take you days or weeks to accomplish?

Although you could simply download the library directly from https://github.com/mongodb/mongo-php-library, it's probably best to install it using Composer ...

Get MongoDB 4 Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.