Added note that on Windows PHP 5.3 or later mysqli uses mysqlnd by default.

Reformatted file.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@270626 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Anthony Bedford 2008-12-05 17:12:46 +00:00
parent a9300f4fda
commit 04a678fef1

View file

@ -1,65 +1,81 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<section xml:id="mysqli.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.install;
<para xml:id="mysqli.configure">
To install the mysqli extension for PHP, use the
To install the <literal>mysqli</literal> extension for PHP, use the
<option role="configure">--with-mysqli=mysql_config_path/mysql_config</option>
configuration option where <literal>mysql_config_path</literal> represents
the location of the <literal>mysql_config</literal> program that comes
with MySQL versions greater than 4.1.
configuration option where <literal>mysql_config_path</literal>
represents the location of the <literal>mysql_config</literal> program
that comes with MySQL versions greater than 4.1.
</para>
<para>
With versions of PHP 5.3 or newer it is possible to alternatively use
<option role="configure">--with-mysqli=mysqlnd</option>. This is the recommended
option as using the MySQL Native Driver results in improved performance and
gives access to features not available when using the MySQL Client Library.
Refer to <link linkend="mysqli.overview.mysqlnd">What is PHP's MySQL Native
Driver?</link> for a brief overview of the advantages of MySQL Native Driver.
With versions of PHP 5.3 and newer, you can alternatively use
<option role="configure">--with-mysqli=mysqlnd</option>. This is the
recommended option as using the MySQL Native Driver results in
improved performance and gives access to features not available when
using the MySQL Client Library. Refer to
<link linkend="mysqli.overview.mysqlnd">What is PHP's MySQL Native
Driver?</link> for a brief overview of the advantages of MySQL Native
Driver.
</para>
<para>
If you would like to install the mysql extension along with the mysqli extension
you have to use the same client library to avoid any conflicts.
If you would like to install the mysql extension along with the mysqli
extension you have to use the same client library to avoid any
conflicts.
</para>
<section xml:id="mysqli.installation.windows">
<title>Installation on Windows Systems</title>
<para>
MySQLi is not enabled by default, so the
<filename>php_mysqli.dll</filename> DLL must be enabled inside of
The <literal>mysqli</literal> extension is not enabled by default, so
the <filename>php_mysqli.dll</filename> DLL must be enabled inside of
&php.ini;. Also, PHP needs access to the MySQL client library. A file
named <filename>libmysql.dll</filename> is included in the Windows PHP
distribution and in order for PHP to talk to MySQL this file needs to be
available to the Windows systems <envar>PATH</envar>. See the FAQ
titled "<link linkend="faq.installation.addtopath">How do I add my PHP
directory to the PATH on Windows</link>" for information on how to do
this. Although copying <filename>libmysql.dll</filename> to the Windows
system directory also works (because the system directory is by default in
the system's <envar>PATH</envar>), it's not recommended.
named <filename>libmysql.dll</filename> is included in the Windows
PHP distribution and in order for PHP to talk to MySQL this file
needs to be available to the Windows systems <envar>PATH</envar>. See
the FAQ titled "<link linkend="faq.installation.addtopath">How do I
add my PHP directory to the PATH on Windows</link>" for information
on how to do this. Although copying <filename>libmysql.dll</filename>
to the Windows system directory also works (because the system
directory is by default in the system's <envar>PATH</envar>), it's
not recommended.
</para>
<para>
On Windows, for PHP versions 5.3 and newer, the
<literal>mysqli</literal> extension uses the MySQL Native Driver by
default. This means you don't need to worry about configuring access
to <filename>libmysql.dll</filename>.
</para>
<para>
As with enabling any PHP extension (such as
<filename>php_mysqli.dll</filename>), the PHP directive
<link linkend="ini.extension-dir">extension_dir</link> should be set to
the directory where the PHP extensions are located. See also the
<link linkend="ini.extension-dir">extension_dir</link> should be set
to the directory where the PHP extensions are located. See also the
<link linkend="install.windows.manual">Manual Windows Installation
Instructions</link>. An example extension_dir value for PHP 5 is
<literal>c:\php\ext</literal>
</para>
<note>
<para>
If when starting the web server an error similar to the following occurs:
<literal>"Unable to load dynamic library './php_mysqli.dll'"</literal>,
this is because <filename>php_mysqli.dll</filename> and/or
If when starting the web server an error similar to the following
occurs: <literal>"Unable to load dynamic library
'./php_mysqli.dll'"</literal>, this is because
<filename>php_mysqli.dll</filename> and/or
<filename>libmysql.dll</filename> cannot be found by the system.
</para>
</note>
</section>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@ -80,4 +96,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->