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

138 lines
4.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<section id="mysql.installation">
&reftitle.install;
<para id="mysql.configure">
For compiling, simply use the
<option role="configure">--with-mysql[=DIR]</option>
configuration option where the optional <literal>[DIR]</literal> points to
the MySQL installation directory.
</para>
<para>
Although this MySQL extension is compatible with MySQL 4.1.0 and greater,
it doesn't support the extra functionality that these versions provide.
For that, use the <link linkend="ref.mysqli">MySQLi</link> extension.
</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.
</para>
<section id="mysql.installation.linux">
<title>Installation on Linux Systems</title>
<section>
<title>PHP 4</title>
<para>
The option <option role="configure">--with-mysql</option> is
enabled by default. This default behavior may be disabled with the
<option role="configure">--without-mysql</option> configure option.
If MySQL is enabled without specifying the path to the
MySQL install DIR, PHP will use the bundled MySQL client libraries.
</para>
<para>
Users who run other applications that use MySQL (for example,
auth-mysql) should not use the bundled library, but rather specify the
path to MySQL's install directory, like so:
<option role="configure">--with-mysql=/path/to/mysql</option>.
This will force PHP to use the client libraries installed by MySQL, thus
avoiding any conflicts.
</para>
</section>
<section>
<title>PHP 5+</title>
<para>
MySQL is not enabled by default, nor is the MySQL library
bundled with PHP. Read this <link linkend="faq.databases.mysql.php5">
FAQ</link> for details on why. Use the
<option role="configure">--with-mysql[=DIR]</option> configure option
to include MySQL support.
You can download <emphasis>headers and libraries</emphasis> from
<ulink url="&url.mysql;">MySQL</ulink>.
</para>
</section>
</section>
<section id="mysql.installation.windows">
<title>Installation on Windows Systems</title>
<section>
<title>PHP 4</title>
<para>
The PHP MySQL extension is compiled into PHP.
</para>
</section>
<section>
<title>PHP 5+</title>
<para>
MySQL is no longer enabled by default, so the
<filename>php_mysql.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.
</para>
<para>
As with enabling any PHP extension (such as
<filename>php_mysql.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="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_mysql.dll'"</literal>,
this is because <filename>php_mysql.dll</filename> and/or
<filename>libmysql.dll</filename> cannot be found by the system.
</para>
</note>
</section>
</section>
<section id="mysql.installation.notes">
<title>MySQL Installation Notes</title>
<warning>
<para>
Crashes and startup problems of PHP may be encountered
when loading this extension in conjunction with the recode extension.
See the <link linkend="ref.recode">recode</link> extension for more
information.
</para>
</warning>
<note>
<para>
If you need charsets other than <emphasis>latin</emphasis> (default), you
have to install external (not bundled) libmysql with compiled charset
support.
</para>
</note>
</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:"../../../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
-->