From fd4b1601e4e90f75f6b869f2337ae102cbd7ba20 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 24 Jan 2018 00:11:28 +0000 Subject: [PATCH] Improve MongoDB installation docs for 1.4.0 This improves discussion around configure options for manual builds, reminds users that each version of PHP has its own PECL command and INI file, and encourages Homebrew users to rely on the formula install method. https://jira.mongodb.org/browse/PHPC-1055 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@343859 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongodb/configure.xml | 118 +++++++++++++++++++++++--------- 1 file changed, 86 insertions(+), 32 deletions(-) diff --git a/reference/mongodb/configure.xml b/reference/mongodb/configure.xml index c5660110f8..e1f4dae543 100644 --- a/reference/mongodb/configure.xml +++ b/reference/mongodb/configure.xml @@ -13,7 +13,7 @@ - Linux, Unix, and OS X users may run the following command to install the + Linux, Unix, and macOS users may run the following command to install the driver: - Installing the driver via PECL will use bundled versions of - libbson and - libmongoc and rely on PHP - to find OpenSSL (i.e. PHP_SETUP_OPENSSL). If the build - process fails to find OpenSSL, check that the OpenSSL development package - (e.g. libssl-dev) and - pkg-config are both - installed. + macOS Homebrew users should consider using the + Homebrew installation + process instead of manually installing the driver via PECL. - Add the following line to your &php.ini; file: + If your system has multiple version of PHP installed (e.g. macOS default + and 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:
- Installing the MongoDB PHP Driver on OSX with Homebrew + Installing the MongoDB PHP Driver on macOS with Homebrew If you are using Homebrew, the PHP tap includes formulae for installing the driver on various PHP versions. - - php54-mongodb - php55-mongodb - php56-mongodb - php70-mongodb - - For example, you might install the driver for PHP 7.0 using the following command: @@ -104,31 +118,71 @@ extension=php_mongodb.dll + + If your system has multiple version of PHP installed (e.g. macOS default + and XAMPP), note + that each version of PHP has its own + phpize command and &php.ini; file. + + + + By default, the driver will use bundled versions of + libbson and + libmongoc and attempt to + configure them on its own. If libbson and libmongoc are already installed as + system libraries, you can instruct the driver to utilize them by specifying + --with-libbson=yes --with--libmongoc=yes as arguments to + configure. + + + + For a complete list of configure options, run + configure --help. + + + + When using bundled versions of libbson and libmongoc, the driver will also + attempt to select an SSL library according to the + --with-mongodb-ssl option for + configure. The default value is + --with-mongodb-ssl=auto, which will search for OpenSSL, + LibreSSL, and Secure Transport (macOS only), in that order. Additionally, you + may specify openssl, libressl, or + darwin to force selection of a particular library, + respectively. + + - - By default, the driver will use bundled versions of - libbson and - libmongoc and rely on PHP - to find OpenSSL (i.e. PHP_SETUP_OPENSSL). If the build - process fails to find OpenSSL, check that the OpenSSL development package - (e.g. libssl-dev) and + + 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. - + + + + When using Homebrew on macOS, it is common for a system to have multiple + versions of OpenSSL installed. To ensure that the desired version of OpenSSL + is selected, the PKG_CONFIG_PATH environment variable may + be used to control the search path for pkg-config. If + pkg-config is not used, configure also + supports a --with-openssl-dir=DIR argument, which can be + used to specify a manual search path (for OpenSSL only). + - The last step will report where mongodb.so has been - installed, similar to: + The final build step, make install, will report where + mongodb.so has been installed, similar to: Ensure that the extension_dir option in &php.ini; points to the directory where mongodb.so - was installed. You can query the option by running: + was installed. You can query for the option by running: - Add the following line to your &php.ini; file: + Finally, add the following line to your &php.ini; file: