reference/mysqli/configure.xml
050e16021ff71318012fa16322e98d8603d5ab38
...
...
@@ -16,22 +16,27 @@
16
16
<para>
17
17
The common Unix distributions include binary versions of PHP that can
18
18
be installed. Although these binary versions are typically built with
19
-
support for MySQL extensions enabled, the extension libraries
19
+
support for the MySQL extensions, the extension libraries
20
20
themselves may need to be installed using an additional package. Check
21
-
the package manager than comes with your chosen distribution for
21
+
the package manager that comes with your chosen distribution for
22
22
availability.
23
23
</para>
24
24
25
25
<para>
26
-
Unless your Unix distribution comes with a binary package of PHP with
27
-
the <literal>mysqli</literal> extension available, you will need to
28
-
build PHP from source code. Building PHP from source allows you to
29
-
specify the MySQL extensions you want to use, as well as your choice
30
-
of client library for each extension.
26
+
For example, on Ubuntu the <literal>php5-mysql</literal> package installs
27
+
the ext/mysql, ext/mysqli, and pdo_mysql PHP extensions. On CentOS,
28
+
the <literal>php-mysql</literal> package also installs these three
29
+
PHP extensions.
31
30
</para>
32
31

33
32
<para>
34
-
The MySQL Native Driver is the recommended option, as it
33
+
Alternatively, you can compile this extension yourself. Building PHP from
34
+
source allows you to specify the MySQL extensions you want to use, as well
35
+
as your choice of client library for each extension.
36
+
</para>
37
+

38
+
<para>
39
+
The MySQL Native Driver is the recommended client library option, as it
35
40
results in improved performance and gives access to features not
36
41
available when using the MySQL Client Library. Refer to
37
42
<link linkend="mysqli.overview.mysqlnd">What is PHP's MySQL Native
...
...
@@ -45,7 +50,7 @@
45
50
Server.
46
51
</para>
47
52

48
-
<table>
53
+
<table xml:id="mysqli.installation.time.matrix">
49
54
<title>mysqli compile time support matrix</title>
50
55
<tgroup cols="5">
51
56
<thead>
...
...
@@ -53,31 +58,31 @@
53
58
<entry>PHP &Version;</entry>
54
59
<entry>&Default;</entry>
55
60
<entry>&ConfigureOptions;: <link linkend="mysqlnd.overview">mysqlnd</link></entry>
56
-
<entry>&ConfigureOptions;: <literal>libmysql</literal></entry>
61
+
<entry>&ConfigureOptions;: <literal>libmysqlclient</literal></entry>
57
62
<entry>&Changelog;</entry>
58
63
</row>
59
64
</thead>
60
65
<tbody>
61
66
<row>
62
-
<entry>5.0.x, 5.1.x, 5.2.x</entry>
63
-
<entry>libmysql</entry>
64
-
<entry>&NotAvailable;</entry>
67
+
<entry>5.4.x and above</entry>
68
+
<entry>mysqlnd</entry>
69
+
<entry><option role="configure">--with-mysqli</option></entry>
65
70
<entry><option role="configure">--with-mysqli=/path/to/mysql_config</option></entry>
66
-
<entry></entry>
71
+
<entry>mysqlnd is the default</entry>
67
72
</row>
68
73
<row>
69
74
<entry>5.3.x</entry>
70
-
<entry>libmysql</entry>
75
+
<entry>libmysqlclient</entry>
71
76
<entry><option role="configure">--with-mysqli=mysqlnd</option></entry>
72
77
<entry><option role="configure">--with-mysqli=/path/to/mysql_config</option></entry>
73
-
<entry>mysqlnd is now supported</entry>
78
+
<entry>mysqlnd is supported</entry>
74
79
</row>
75
80
<row>
76
-
<entry>5.4.x</entry>
77
-
<entry>mysqlnd</entry>
78
-
<entry><option role="configure">--with-mysqli</option></entry>
81
+
<entry>5.0.x, 5.1.x, 5.2.x</entry>
82
+
<entry>libmysqlclient</entry>
83
+
<entry>&NotAvailable;</entry>
79
84
<entry><option role="configure">--with-mysqli=/path/to/mysql_config</option></entry>
80
-
<entry>mysqlnd is now the default</entry>
85
+
<entry>mysqlnd is not supported</entry>
81
86
</row>
82
87
</tbody>
83
88
</tgroup>
...
...
@@ -86,26 +91,12 @@
86
91
<para>
87
92
Note that it is possible to freely mix MySQL extensions and client
88
93
libraries. For example, it is possible to enable the MySQL extension
89
-
to use the MySQL Client Library (libmysql), while configuring the
94
+
to use the MySQL Client Library (libmysqlclient), while configuring the
90
95
<literal>mysqli</literal> extension to use the MySQL Native Driver.
91
96
However, all permutations of extension and client library are
92
97
possible.
93
98
</para>
94
99

95
-
<para>
96
-
The following example builds the MySQL extension to use the MySQL
97
-
Client Library, and the <literal>mysqli</literal> and PDO MYSQL
98
-
extensions to use the MySQL Native Driver:
99
-
</para>
100
-

101
-
<programlisting role="shell">
102
-
<![CDATA[
103
-
./configure --with-mysql=/usr/bin/mysql_config \
104
-
--with-mysqli=mysqlnd \
105
-
--with-pdo-mysql=mysqlnd
106
-
[other options]
107
-
]]>
108
-
</programlisting>
109
100
</section>
110
101

111
102
<section xml:id="mysqli.installation.windows">
...
...
@@ -113,81 +104,28 @@
113
104
<title>Installation on Windows Systems</title>
114
105

115
106
<para>
116
-
On Windows, PHP is most commonly installed using the binary
117
-
installer.
107
+
On Windows, <filename>php_mysqli.dll</filename> DLL must be enabled in
108
+
&php.ini;.
118
109
</para>
119
110

120
-
<section>
121
-

122
-
<title>PHP 5.0, 5.1, 5.2</title>
123
-

124
-
<para>
125
-
Once PHP has been installed, some configuration is
126
-
required to enable <literal>mysqli</literal> and specify the client
127
-
library you want it to use.
128
-
</para>
129
-

130
-
<para>
131
-
The <literal>mysqli</literal> extension is not
132
-
enabled by default, so the <filename>php_mysqli.dll</filename> DLL
133
-
must be enabled inside of &php.ini;. In order to do this you need to
134
-
find the &php.ini; file (typically located in
135
-
<filename>c:\php</filename>), and make sure you remove the comment
136
-
(semi-colon) from the start of the line
137
-
<literal>extension=php_mysqli.dll</literal>, in the section marked
138
-
<literal>[PHP_MYSQLI]</literal>.
139
-
</para>
140
-

141
-
<para>
142
-
Also, if you want to use the MySQL Client Library with
143
-
<literal>mysqli</literal>, you need to make sure PHP can access the
144
-
client library file. The MySQL Client Library is included as a file
145
-
named <filename>libmysql.dll</filename> in the Windows PHP
146
-
distribution. This file needs to be available in the Windows system's
147
-
<envar>PATH</envar> environment variable, so that it can be
148
-
successfully loaded. See the FAQ titled
149
-
"<link linkend="faq.installation.addtopath">How do I add my PHP
150
-
directory to the PATH on Windows</link>" for information on how to do
151
-
this. Copying <filename>libmysql.dll</filename> to the Windows system
152
-
directory (typically <filename>c:\Windows\system</filename>) also
153
-
works, as the system directory is by default in the system's
154
-
<envar>PATH</envar>. However, this practice is strongly discouraged.
155
-
</para>
156
-

157
-
<para>
158
-
As with enabling any PHP extension (such as
159
-
<filename>php_mysqli.dll</filename>), the PHP directive
160
-
<link linkend="ini.extension-dir">extension_dir</link> should be set
161
-
to the directory where the PHP extensions are located. See also the
162
-
<link linkend="install.windows.manual">Manual Windows Installation
163
-
Instructions</link>. An example <literal>extension_dir</literal>
164
-
value for PHP 5 is <filename>c:\php\ext</filename>.
165
-
</para>
166
-

167
-
<note>
168
-
<para>
169
-
If when starting the web server an error similar to the following
170
-
occurs: <literal>"Unable to load dynamic library
171
-
'./php_mysqli.dll'"</literal>, this is because
172
-
<filename>php_mysqli.dll</filename> and/or
173
-
<filename>libmysql.dll</filename> cannot be found by the system.
174
-
</para>
175
-
</note>
176
-
</section>
177
-

178
-
<section>
179
-

180
-
<title>PHP 5.3.0+</title>
111
+
<para>
112
+
As with enabling any PHP extension (such as
113
+
<filename>php_mysqli.dll</filename>), the PHP directive
114
+
<link linkend="ini.extension-dir">extension_dir</link> should be set
115
+
to the directory where the PHP extensions are located. See also the
116
+
<link linkend="install.windows.manual">Manual Windows Installation
117
+
Instructions</link>. An example <literal>extension_dir</literal>
118
+
value is <filename>c:\php\ext</filename>.
119
+
</para>
181
120

121
+
<note>
182
122
<para>
183
-
On Windows, for PHP versions 5.3 and newer, the
184
-
<literal>mysqli</literal> extension is enabled and
185
-
uses the MySQL Native Driver by default. This means you don't need to
186
-
worry about configuring access
187
-
to <filename>libmysql.dll</filename>.
123
+
If when starting the web server an error similar to the following
124
+
occurs: <literal>"Unable to load dynamic library
125
+
'./php_mysqli.dll'"</literal>, this is because
126
+
<filename>php_mysqli.dll</filename> cannot be found by the system.
188
127
</para>
189
-

190
-
</section>
128
+
</note>
191
129

192
130
</section>
193
131

194
132