📄 mysql.installation.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Installation</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysql.setup.html">Installing/Configuring</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysql.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="mysql.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="mysql.installation" class="section"> <h2 class="title">Installation</h2> <p class="para" id="mysql.configure" name="mysql.configure"> For compiling, simply use the <span class="option">--with-mysql[=DIR]</span> configuration option where the optional <i>[DIR]</i> points to the MySQL installation directory. </p> <p class="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 <a href="ref.mysqli.html" class="link">MySQLi</a> extension. </p> <p class="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. </p> <div id="mysql.installation.linux" class="section"> <h2 class="title">Installation on Linux Systems</h2> <div class="section"> <h2 class="title">PHP 4</h2> <p class="para"> The option <span class="option">--with-mysql</span> is enabled by default. This default behavior may be disabled with the <span class="option">--without-mysql</span> configure option. If MySQL is enabled without specifying the path to the MySQL install DIR, PHP will use the bundled MySQL client libraries. </p> <p class="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: <span class="option">--with-mysql=/path/to/mysql</span>. This will force PHP to use the client libraries installed by MySQL, thus avoiding any conflicts. </p> </div> <div class="section"> <h2 class="title">PHP 5+</h2> <p class="para"> MySQL is not enabled by default, nor is the MySQL library bundled with PHP. Read this <a href="faq.databases.html#faq.databases.mysql.php5" class="link"> FAQ</a> for details on why. Use the <span class="option">--with-mysql[=DIR]</span> configure option to include MySQL support. You can download <em class="emphasis">headers and libraries</em> from <a href="http://www.mysql.com/" class="link external">» MySQL</a>. </p> </div> </div> <div id="mysql.installation.windows" class="section"> <h2 class="title">Installation on Windows Systems</h2> <div class="section"> <h2 class="title">PHP 4</h2> <p class="para"> The PHP MySQL extension is compiled into PHP. </p> </div> <div class="section"> <h2 class="title">PHP 5+</h2> <p class="para"> MySQL is no longer enabled by default, so the <var class="filename">php_mysql.dll</var> DLL must be enabled inside of <var class="filename">php.ini</var>. Also, PHP needs access to the MySQL client library. A file named <var class="filename">libmysql.dll</var> 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 <span class="envar">PATH</span>. See the FAQ titled "<a href="faq.installation.html#faq.installation.addtopath" class="link">How do I add my PHP directory to the PATH on Windows</a>" for information on how to do this. Although copying <var class="filename">libmysql.dll</var> to the Windows system directory also works (because the system directory is by default in the system's <span class="envar">PATH</span>), it's not recommended. </p> <p class="para"> As with enabling any PHP extension (such as <var class="filename">php_mysql.dll</var>), the PHP directive <a href="ini.core.html#ini.extension-dir" class="link">extension_dir</a> should be set to the directory where the PHP extensions are located. See also the <a href="install.windows.manual.html" class="link">Manual Windows Installation Instructions</a>. An example extension_dir value for PHP 5 is <i>c:\php\ext</i> </p> <blockquote><p><b class="note">Note</b>: If when starting the web server an error similar to the following occurs: <i>"Unable to load dynamic library './php_mysql.dll'"</i>, this is because <var class="filename">php_mysql.dll</var> and/or <var class="filename">libmysql.dll</var> cannot be found by the system. <br /> </p></blockquote> </div> </div> <div id="mysql.installation.notes" class="section"> <h2 class="title">MySQL Installation Notes</h2> <div class="warning"><b class="warning">Warning</b> <p class="para"> Crashes and startup problems of PHP may be encountered when loading this extension in conjunction with the recode extension. See the <a href="ref.recode.html" class="link">recode</a> extension for more information. </p> </div> <blockquote><p><b class="note">Note</b>: If you need charsets other than <em class="emphasis">latin</em> (default), you have to install external (not bundled) libmysql with compiled charset support. <br /> </p></blockquote> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysql.setup.html">Installing/Configuring</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysql.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="mysql.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -