Installing the MongoDB PHP Driver with PECL

安裝此 PECL 擴(kuò)展相關(guān)的信息可在手冊中標(biāo)題為 PECL 擴(kuò)展的安裝章節(jié)中找到。更多信息如新的發(fā)行版本、下載、源文件、 維護(hù)人員信息及變更日志等,都在此處: ? https://pecl.php.net/package/mongodb

Linux, Unix, and macOS users may run the following command to install the driver:

$ sudo pecl install mongodb

If your system has multiple version of PHP installed (e.g. macOS default, Homebrew, ? XAMPP), note that each version of PHP has its own pecl command and php.ini file.

Installing the driver via PECL will use bundled versions of ? libbson and ? libmongoc and attempt to automatically configure them.

注意: If the build process fails to find an SSL library, check that the development packages (e.g. libssl-dev) and ? pkg-config are both installed. If that does not resolve the problem, consider using the manual installation process.

Finally, add the following line to your php.ini file:

extension=mongodb.so