When you use Apache2.4 and php5.5 to configure an independent environment, printing phpinfo also shows that it is successful. You can see the enabled extension items, but it does not show mysql, the mysql extension is not displayed, but mysqlnd is displayed, and the mysql database cannot be connected. I don't know what it is... when you use Apache2.4 and php5.5 to configure an independent environment, printing phpinfo also shows that it is successful. You can see the enabled extension items, but it does not show mysql, the mysql extension is not displayed, but mysqlnd is displayed, and the mysql database cannot be connected. I don't know why.
Reply content:
When you use Apache2.4 and php5.5 to configure an independent environment, printing phpinfo also shows that it is successful. You can see the enabled extension items, but it does not show mysql, the mysql extension is not displayed, but mysqlnd is displayed, and the mysql database cannot be connected. I don't know why.
Mysql, mysqli, and pdo_mysql are implemented by default in PHP from 5.4.
During compilation, PHP5.3 enables mysqlnd support as follows:
--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd
If it is left blank after PHP5.4, mysqlnd: is enabled by default:
--with-mysql--with-mysqli--with-pdo-mysql
PHP7 is not supported at the beginning -- with-mysql.
In addition, if you do not add the -- with-mysql configuration item during compilation, you naturally cannot use the mysql extension function. however, mysql extension will be discarded in PHP 7. You should use mysqli and pdo_mysql extension.
PHP5.4.x uses mysqlnd to connect to mysql by default. Unlike libmysql, PHP supports mysqlnd built-in and uses PHP license authorization to avoid any possible copyright problems.
Http://www.php.net/manual/zh/mysql.installation.php
Mysqlnd does not act as a general library like libmysql. It is a library specially written for PHP. libmysql directly accesses the database, while mysqlnd accesses the database through Zend, which has better performance. You can view the mysqlnd information in phpinfo. before compiling PHP, you must first install MySQL, and then use -- with-mysql = DIR to specify the MySQL location. with the built-in mysqlnd local driver, this is not required.
In addition to copyright protection, mysqlnd is faster than libmysql and saves more memory. It also provides a wide range of performance statistics functions and facilitates PHP compilation. mysqlnd, as a PHP extension, is tightly coupled with PHP and uses the PHP memory management system. Therefore, it consumes less memory than libmysql and is more efficient. memory_get_usage () can be used to track the memory usage of mysqlnd, and it is also limited by the memory usage of memory_limit.
Http://php.net/manual/en/mysqlnd.overview.php
PHP has discarded the original MySQL extension since 5.5 and should be replaced by MySQLi or PDO_MySQL extension.