php-doc-en/reference/mongo/configure.xml

308 lines
7.6 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<section xml:id="mongo.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.install;
<para>
&pecl.moved;
&pecl.info;
<link xlink:href="&url.pecl.package;mongo">&url.pecl.package;mongo</link>.
</para>
<section>
<title>Installing on *NIX</title>
<para>
Run:
<programlisting>
<![CDATA[
$ sudo pecl install mongo
]]>
</programlisting>
</para>
<para>
Add the following line to your php.ini file:
<programlisting>
<![CDATA[
extension=mongo.so
]]>
</programlisting>
</para>
<para>
If pecl runs out of memory, make sure memory_limit in php.ini is set to at least 32M.
</para>
</section>
<section>
<title>Manual Installation</title>
<para>For driver developers and people interested in the latest bugfixes, you
can compile the driver from the latest source on
<link xlink:href="&url.mongodb.github;">Github</link>.
Go to Github and click the "download" button. Then run:
<programlisting>
<![CDATA[
$ tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz
$ cd mongodb-mongodb-php-driver-<commit_id>
$ phpize
$ ./configure
$ sudo make install
]]>
</programlisting>
</para>
<para>
Make the following changes to php.ini:
</para>
<itemizedlist>
<listitem>
<para>
1. The build will display where it is installing the PHP driver with output that looks something like:
<programlisting>
<![CDATA[
Installing '/usr/lib/php/extensions/no-debug-zts-20060613/mongo.so'
]]>
</programlisting>
Make sure that it is the same as the PHP extension directory by runnning:
<programlisting>
<![CDATA[
$ php -i | grep extension_dir
extension_dir => /usr/lib/php/extensions/no-debug-zts-20060613 =>
/usr/lib/php/extensions/no-debug-zts-20060613
]]>
</programlisting>
If it's not, change the extension_dir in php.ini or move mongo.so.
</para>
</listitem>
<listitem>
<para>
2. To load the extension on PHP startup, add a line:
<programlisting>
<![CDATA[
extension=mongo.so
]]>
</programlisting>
</para>
</listitem>
</itemizedlist>
<section>
<title>OS X</title>
<para>
If your system is unable to find autoconf, you'll need to install Xcode
(available on your installation DVD).
</para>
<para>
If you are using XAMPP, you may be able to compile the driver with the
following command:
<programlisting>
<![CDATA[
sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo
]]>
</programlisting>
</para>
<para>
If you are using MAMP (or XAMPP and the above command does not work),
precompiled binaries are available from
<link xlink:href="&url.mongodb.github.downloads;">Github</link>
(download the latest one with "osx" in the name that matches your version of
PHP). Extract mongo.so from the archive and add it to MAMP or XAMPP's
extension directory. Add
<programlisting>
<![CDATA[
extension=mongo.so
]]>
</programlisting>
to the php.ini file being used and restart the server.
</para>
</section>
<section>
<title>Gentoo</title>
<para>On Gentoo using PECL you might get an error that libtool is the wrong
version. Compiling from source you'll need to run aclocal and autoconf.
<programlisting>
<![CDATA[
$ phpize && aclocal && autoconf && ./configure && make && make install
]]>
</programlisting>
(Thanks to <link xlink:href="&url.mongodb.tweet.gentoo;">@riklaunim</link>)
</para>
</section>
<section>
<title>Fedora</title>
<para>
If you don't want to modify php.ini directly, you can create a separate
mongo.ini file. Within the /etc/php.d directory, create a subdirectory named
mongo (or something else you like). In the mongo directory, create a
mongo.ini file. Put the following in your mongo.ini file:
<programlisting>
<![CDATA[
extension=mongo.so
; any other mongo options you'd like (see the Runtime Configuration section)
]]>
</programlisting>
</para>
</section>
</section>
<section>
<title>Installing on Windows</title>
<para>
Precompiled binaries are available 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).
</para>
<itemizedlist>
<listitem>
<para>
<link xlink:href="&url.mongodb.github.downloads;">
PHP 5.3 VC8 and VC9 Mongo extension
</link>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="&url.mongodb.vc6;">
PHP 5.2 and 5.3 VC6 Mongo extension
</link> (you have to search the page for "mongo")
</para>
</listitem>
</itemizedlist>
<para>
The latest (non-release) code is compiled into Windows binaries on every
commit. The zip consists of a .zip with php_mongo.dll and a version.txt.
Please keep the version.txt around so that if you have a question or problem,
you can give the developers the exact version you're using. (The number is
long and nonsensical, but it will make sense to the developers!)
</para>
<para>
To get the latest bug fixes (and possibly bugs), download the binary
corresponding to the PHP you have installed:
</para>
<itemizedlist>
<listitem>
<para>
<link xlink:href="&url.mongodb.vc8;">
PHP 5.3 VC8 Non-Thread-Safe Mongo extension
</link>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="&url.mongodb.vc8ts;">
PHP 5.3 VC8 Thread-Safe Mongo extension
</link>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="&url.mongodb.vc9;">
PHP 5.3 VC9 Non-Thread-Safe Mongo extension
</link>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="&url.mongodb.vc9ts;">
PHP 5.3 VC9 Thread-Safe Mongo extension
</link>
</para>
</listitem>
</itemizedlist>
<para>
Add the following line to your php.ini file:
<programlisting>
<![CDATA[
extension=php_mongo.dll
]]>
</programlisting>
</para>
</section>
<section>
<title>Third-Party Installation Instructions</title>
<para>
A number of people have created excellent tutorials on installing the PHP
driver.
</para>
<itemizedlist>
<listitem>
<para>
<link xlink:href="&url.mongodb.video;">
PHP 5.3.1 with Xdebug, MongoDB and Lithium on Ubuntu 9.10 / Apache 2.2
</link>
</para>
<para>An excellent video that takes you step-by-step through installing
Apache, PHP, Xdebug, MongoDB, and Lithium by Jon Adams.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="&url.mongodb.ubuntu.9.04;">
Installing MongoDB and the PHP driver on Ubuntu 9.04
</link>
</para>
<para>
Spanish article by Javier Aranda (<link xlink:href="&url.mongodb.ubuntu.9.04.en;">
English translation</link>).
</para>
</listitem>
<listitem>
<para>
<link xlink:href="&url.mongodb.osx;">
OS X: Installing MongoDB and the PHP Mongo Driver
</link>
</para>
<para>
By Matt Butcher.
</para>
</listitem>
</itemizedlist>
</section>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->