nginx error.log 提示 [error] 887#887: *58 FastCGI sent in stderr: "PHP message: PHP Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50556 Library:50637

时间:2023-03-08 16:09:46

0.

1.问题

1.1现象:

nginx error.log 提示 [error] 887#887: *58 FastCGI sent in stderr: "PHP message: PHP Warning:  mysql_connect(): Headers and client library minor version mismatch. Headers:50556 Library:50637

https://*.com/questions/10759334/headers-and-client-library-minor-version-mismatch

PHP 遇到 Headers and client library minor version mismatch

1.2确认安装信息:

php -i | grep Client

输出:

Client API version => 5.6.37
Client API library version => 5.6.37
Client API header version => 5.5.56-MariaDB
Client API version => 5.6.37
Soap Client => enabled

1.3解决办法:

直接抑制报错:@mysql_connect();

或重新编译 php:略

或替换为 php-mysqlnd:

2.卸载 yum remove php-mysql 安装 yum install php-mysqlnd      (即 native driver)

mysql_connect(): Headers and client library minor version mismatch. Headers:

提示 phpMyAdmin 将被删除 ,解决办法可参考 https://*.com/questions/31887098/how-to-use-phpmyadmin-with-mysqlnd

Running transaction
正在删除 : phpMyAdmin-4.4.15.10-2.el7.noarch 1/2
警告:/etc/phpMyAdmin/config.inc.php 已另存为 /etc/phpMyAdmin/config.inc.php.rpmsave
警告:/etc/httpd/conf.d/phpMyAdmin.conf 已另存为 /etc/httpd/conf.d/phpMyAdmin.conf.rpmsave
正在删除 : php-mysql-5.4.16-43.el7_4.x86_64 2/2
验证中 : phpMyAdmin-4.4.15.10-2.el7.noarch 1/2
验证中 : php-mysql-5.4.16-43.el7_4.x86_64 2/2 删除:
php-mysql.x86_64 0:5.4.16-43.el7_4 作为依赖被删除:
phpMyAdmin.noarch 0:4.4.15.10-2.el7

2.1卸载之前

mysql

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 5.6.37
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib64/mysql -lmysqlclient

mysqli

MysqlI Support enabled
Client API library version 5.6.37
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0
Client API header version 5.5.56-MariaDB
MYSQLI_SOCKET /var/lib/mysql/mysql.sock

2.2安装之后 重启 nginx,php-fpm

mysql

MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $

mysqli

MysqlI Support enabled
Client API library version mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0