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; instructions, it is unclear why many articles are recommended to add EXTENSION=PHP_ Mysqli.dll; an instruction.
Just check out the official latest PHP manual, which reads:
The following is a list of the built-in extension libraries:
PHP 5 (as of 5.0.4) has the following modifications. Added built-in: DOM,LIBXML,ICONV,SIMPLEXML,SPL and SQLite. The following are no longer built-in: MySQL and Overload.
The original PHP5 does not have these extensions (it can also be concluded that you do not need to add these instructions when using PHP4), as well as why the php5 no longer binds to the MySQL client library, as explained in the manual:
Part of the reason is (no specific order):
。 Most systems now have a client library installed.
。 For these reasons, keeping multiple versions of a library file can cause confusion. For example, if you connect a mod_auth_mysql to a version, but connect PHP to another version, and then activate them in Apache at the same time, you get countless errors. In addition, the bound library file does not always work well with the server-side version. The most obvious symptom of this is where to find the UNIX domain socket file mysql.socket.
。 The maintenance was somewhat lax, and was already lagging behind the release of the release.
。 The future version of the library is based on the GPL, so we don't have a way to upgrade because we can't bind the GPL-based libraries and Bsd/apache-style license items together. So having a clean PHP 5 is the best option.
The reason why two extension libraries are activated for PHP when configured is because:
。 In order to access the MySQL database server using basic function operations, you must add MySQL support when you configure PHP, which is to use the Php_mysql.dll extension library.
。 Although the Php_mysql.dll extension library is compatible with the later versions of the MySQL 4.1.0 machine, it does not support the additional features provided by these editions, and the Php_mysqli.dll extension Library is also required to use these features.
PHP 4 (as of PHP 4.3.11): Bcmath,caledar,com,ctype,ftp,mysql,odbc,overload,pcre,session,tokenizer,wddx,xml and Zlib.
The above describes the Extension_dir on the Phpini to add Extension=php_mysqlidll instructions, including the extension_dir aspects of the content, I hope that the PHP tutorial interested in a friend helpful.