MySQL Improved Extension (
Mysqli
)
2333
themselves may need to be installed using an additional package. Check the package manager than
comes with your chosen distribution for availability.
Unless your Unix distribution comes with a binary package of PHP with the
mysqli
extension
available, you will need to build PHP from source code. Building PHP from source allows you to specify
the MySQL extensions you want to use, as well as your choice of client library for each extension.
The MySQL Native Driver is the recommended option, as it results in improved performance and gives
access to features not available when using the MySQL Client Library. Refer to
What is PHP's MySQL
Native Driver? [2309]
for a brief overview of the advantages of MySQL Native Driver.
The
/path/to/mysql_config
represents the location of the
mysql_config
program that comes
with MySQL Server.
Table 20.38. mysqli compile time support matrix
PHP Version
Default
Configure
Options:
mysqlnd
Configure
Options:
libmysqlclient
Changelog
5.0.x, 5.1.x, 5.2.x
libmysqlclient
Not Available
--with-
mysqli=/
path/to/
mysql_config
5.3.x
libmysqlclient
--with-
mysqli=mysqlnd
--with-
mysqli=/
path/to/
mysql_config
mysqlnd is now
supported
5.4.x
mysqlnd
--with-mysqli
--with-
mysqli=/
path/to/
mysql_config
mysqlnd is now the
default
Note that it is possible to freely mix MySQL extensions and client libraries. For example, it is possible
to enable the MySQL extension to use the MySQL Client Library (libmysqlclient), while configuring the
mysqli
extension to use the MySQL Native Driver. However, all permutations of extension and client
library are possible.
The following example builds the MySQL extension to use the MySQL Client Library, and the
mysqli
and PDO MYSQL extensions to use the MySQL Native Driver:
./configure --with-mysql=/usr/bin/mysql_config \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd
[other options]
20.7.3.4.2.2. Installation on Windows Systems
Copyright 1997-2012 the PHP Documentation Group. [2230]
On Windows, PHP is most commonly installed using the binary installer.
20.7.3.4.2.2.1. PHP 5.0, 5.1, 5.2
Copyright 1997-2012 the PHP Documentation Group. [2230]
Once PHP has been installed, some configuration is required to enable
mysqli
and specify the client
library you want it to use.
The
mysqli
extension is not enabled by default, so the
php_mysqli.dll
DLL must be enabled
inside of
php.ini
. In order to do this you need to find the
php.ini
file (typically located
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...