インストール手順警告
この拡張モジュールは非推奨です。 かわりに MongoDB 拡張モジュールを使うべきです。 The MongoDB PHP driver should work on nearly any system: Windows, macOS, Unix, and Linux; little- and big-endian machines; 32- and 64-bit machines; PHP 5.3 through 5.6 (versions prior to 1.6 also support PHP 5.2). この » PECL 拡張 モジュールは PHP にバンドルされていません。
Manual InstallationFor driver developers and people interested in the latest bugfixes, you can compile the driver from the latest source code on » Github. Go to Github and click the "download" button. Then run: $ tar zxvf mongo-php-driver-legacy-<commit_id>.tar.gz $ cd mongo-php-driver-legacy-<commit_id> $ phpize $ ./configure $ make all $ sudo make install Make the following changes to php.ini:
Installing on *NIXRun: $ sudo pecl install mongo Add the following line to your php.ini file: extension=mongo.so If pecl runs out of memory while installing, make sure memory_limit in php.ini is set to at least 128MB. Installing on WindowsPrecompiled binaries for each release are available from » PECL for a variety of combinations of versions, thread safety, and VC libraries. Unzip the archive and put php_mongo.dll in your PHP extension directory ("ext" by default). Add the following line to your php.ini file: extension=php_mongo.dll
macOSIn most cases installing from PECL is the easiest way: $ sudo pecl install mongo 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.
GentooGentoo has a package for the PHP PECL driver called dev-php/pecl-mongo, which can be installed with: $ sudo emerge -va dev-php/pecl-mongo If you use PECL, you may get an error that libtool is the wrong version. Compiling from source you'll need to run aclocal and autoconf. $ phpize $ aclocal $ autoconf $ ./configure $ make $ sudo make install Red HatThis includes Fedora and CentOS. The default Apache settings on these systems do not let requests make network connections, meaning that the driver will get "Permission denied" errors when it tries to connect to the database. If you run into this, try running: $ /usr/sbin/setsebool -P httpd_can_network_connect 1 Third-Party Installation InstructionsA number of people have created excellent tutorials on installing the PHP driver.
|