robin 发表于 2018-12-21 11:25:09

php 5.4 不使用mysqlnd

  由于微博在测试php5.4的相关性能,在5.4开始mysqlnd变成了默认的驱动,
  相关说明如下:


[*]PHP 5.4 has mysqlnd as default
[*]
[*]As of PHP 5.4, the mysqlnd library is a php.net compile time default to all PHP MySQL extensions. Also, the php.net Windows team is using mysqlnd for the official PHP Windows distribution since mysqlnd became available in PHP 5.3.
[*]Advantages of using mysqlnd
[*]
[*]The mysqlnd library is highly optimized for and tightly integrated into PHP. The MySQL Client Library cannot offer the same optimizations because it is a general-purpose client library.
[*]
[*]The mysqlnd library is using PHP internal C infrastructure for seamless integration into PHP. In addition, it is using PHP memory management, PHP Streams (I/O abstraction) and PHP string handling routines. The use of PHP memory management by mysqlnd allows, for example, memory savings by using read-only variables (copy on write) and makes mysqlnd apply to PHP memory limits. Additional advantages include:

  而原有的数据库密码限制导致mysqlnd无法使用,还得使用libmysql驱动,导致php5.4需重新编译,我查看相关configure,将mysqlnd禁用不好使,发现语法判定只要指定mysql支持且不指定相关mysql base设置就会把mysqlnd作为默认驱动 。
  下面是该后的相关编译选项:


[*]--with-mysql=/usr \
[*]--with-mysqli=shared,/usr/bin/mysql_config
[*]--with-pdo-mysql=shared,/usr

  后重新编译后测试生效



页: [1]
查看完整版本: php 5.4 不使用mysqlnd