When configuring PHP5 to use MySQL as a database, many people think that as long as the php.ini to add Extension=php_mysql.dll, the instructions can not understand why many articles are recommended to add EXTENSION=PHP_ Mysqli.dll of the order;
Just look at the official latest PHP manual, which says:
The following is a built-in list of extension libraries:
The following modifications are available in PHP 5 (up to 5.0.4). New built-in: DOM,LIBXML,ICONV,SIMPLEXML,SPL and SQLite. The following is no longer built-in: MySQL and overload.
The original PHP5 did not have these extensions built (and, of course, you don't need to add these instructions when using PHP4), as for why PHP5 no longer has a client library that is not bound to MySQL, which is also described in the manual:
Part of the reason is (no specific order):
。 Today, most systems already have client libraries installed.
。 For the above reasons, maintaining multiple versions of the library file can cause confusion. For example, if you connect Mod_auth_mysql to a version, but connect PHP to another version, and then activate them in Apache, you get countless bugs. Also, bound library files do not always work well with server-side versions. The most obvious symptom is where to find the UNIX domain socket file mysql.socket.
。 Maintenance has been somewhat lax and has been lagging increasingly behind the release version.
。 The future version of the library is based on the GPL, so we have no way to upgrade because we cannot bind the GPL based libraries and Bsd/apache style license items together. So having a clean PHP 5 is the best option.
The reason for activating two extensions for PHP at configuration time is because:
。 In order to access the MySQL database server using basic function operations, you must add MySQL support when configuring PHP, that is, to use the Php_mysql.dll extension library.
。 Although the Php_mysql.dll extension library is compatible with the MySQL 4.1.0 machine version, it does not support the additional functionality provided by these versions, and the Php_mysqli.dll extension Library is required to use these features.
PHP 4 (up to PHP 4.3.11): Bcmath,caledar,com,ctype,ftp,mysql,odbc,overload,pcre,session,tokenizer,wddx,xml and Zlib.