Rewrote and restructered these docs so hopefully Windows users will be able

to install MySQL with PHP 5. All of them. No more questions.
Used titled sections which seemed like the best way to seperate the content.
TODO: Document issues with the bundled libmysql.dll vs. the one that comes with MySQL itself.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@184163 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2005-04-11 20:20:45 +00:00
parent 9b0087b327
commit 1599554504

View file

@ -1,47 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<section id="mysql.installation">
&reftitle.install;
<para id="mysql.configure">
By using the <option role="configure">--with-mysql[=DIR]</option>
configuration option you enable PHP to access MySQL
databases.
</para>
<para>
In PHP 4, the option <option role="configure">--with-mysql</option> is
enabled by default. To disable this default behavior, you may use the
<option role="configure">--without-mysql</option> configure option.
Also in PHP 4, if you enable MySQL without specifying the path to the
MySQL install DIR, PHP will use the bundled MySQL client
libraries. In Windows, there is no DLL, it's simply built into PHP 4.
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>
<para>
In PHP 5, MySQL is no longer 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.
</para>
<note>
<para>
Windows users will need to enable <filename>php_mysql.dll</filename>
inside of &php.ini; and either copy <filename>libmysql.dll</filename>
into the Windows system directory, or make it available to the <envar>PATH</envar>.
</para>
<para>
This will fix "Unable to load dynamic library './php_mysql.dll'" errors.
</para>
</note>
<para>
For compiling, simply use
<option role="configure"> --with-mysql=[DIR]</option> where
<literal>[DIR]</literal> points to your MySQL installation directory.
<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>
This MySQL extension doesn't support full functionality of MySQL versions greater than
@ -51,21 +17,100 @@
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>
<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 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.
</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 systems <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