Installing the MongoDB PHP Driver with PECL

安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装章节中找到。更多信息如新的发行版本、下载、源文件、 维护人员信息及变更日志等,都在此处: » 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 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.

Note: 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

相关文章
php mongodb driver exception the mongodb driver exception authenticationexception classphp mongodb driver exception the mongodb driver exception bulkwriteexception classphp mongodb driver monitoring the mongodb driver monitoring commandsucceededevent classphp mongodb driver monitoring the mongodb driver monitoring subscriber interfacephp mongodb driver cursor returns the server associated with this cursorphp mongodb driver cursor checks if the cursor may have additional resultsphp mongodb driver manager return the writeconcern for the managerphp mongodb driver manager select a server matching a read preferencephp mongodb driver monitoring commandsubscriber notification method for a failed commandphp mongodb driver monitoring commandsubscriber notification method for a started commandphp mongodb driver readpreference returns the readpreference s maxstalenessseconds optionphp mongodb driver readpreference returns the readpreference s mode optionphp mongodb driver server returns an integer denoting the type of this serverphp mongodb driver server checks if this server is an arbiter member of a replica setphp mongodb driver writeerror returns the index of the write operation corresponding to this writeerrorphp 安装 installing the mongodb php driver on macos with homebrewphp 安装 manually installing the mongodb php driverphp 安装 installing the mongodb php driver with peclphp 安装 installing the mongodb php driver on windowsphp driver architecture and internals serialization and deserialization of php variables into mongodb
关注编程学问公众号