zabbix3.0 php56 PHP databases support fail
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix3.0 php56 PHP databases support fail相关的知识,希望对你有一定的参考价值。
在搭建zabbix3.0时,登陆界面进行setup时,发现一个检查项没有过去。
显示php databases support fail,用的是mysql5.6
PHP版本是5.6
运行php -version
PHP Warning: PHP Startup: Unable to load dynamic library /usr/lib64/php/modules/mysqli.so - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library /usr/lib64/php/modules/mysql.so - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library /usr/lib64/php/modules/mysqli.so - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library /usr/lib64/php/modules/pdo_mysql.so - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.29 (cli) (built: Dec 10 2016 13:02:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
初步排查是php和MySQL 连接之间的问题。
查了下php与MySQL相关的软件包:
yum list php*
[root@nginx php.d]# yum list php*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* extras: ftp.sjtu.edu.cn
* updates: ftp.sjtu.edu.cn
* webtatic: uk.repo.webtatic.com
Installed Packages
php56w.x86_64 5.6.29-1.w6 @webtatic
php56w-bcmath.x86_64 5.6.29-1.w6 @webtatic
php56w-cli.x86_64 5.6.29-1.w6 @webtatic
php56w-common.x86_64 5.6.29-1.w6 @webtatic
php56w-gd.x86_64 5.6.29-1.w6 @webtatic
php56w-ldap.x86_64 5.6.29-1.w6 @webtatic
php56w-mbstring.x86_64 5.6.29-1.w6 @webtatic
php56w-mysql.x86_64 5.6.29-1.w6 @webtatic
php56w-pdo.x86_64 5.6.29-1.w6 @webtatic
php56w-xml.x86_64 5.6.29-1.w6 @webtatic
Available Packages
php.x86_64 5.3.3-48.el6_8 updates
php-bcmath.x86_64 5.3.3-48.el6_8 updates
php-cli.x86_64 5.3.3-48.el6_8 updates
php-common.x86_64 5.3.3-48.el6_8 updates
php-dba.x86_64 5.3.3-48.el6_8 updates
php-devel.x86_64 5.3.3-48.el6_8 updates
php-embedded.x86_64 5.3.3-48.el6_8 updates
php-enchant.x86_64 5.3.3-48.el6_8 updates
php-fpm.x86_64 5.3.3-48.el6_8 updates
php-gd.x86_64 5.3.3-48.el6_8 updates
php-imap.x86_64 5.3.3-48.el6_8 updates
php-intl.x86_64 5.3.3-48.el6_8 updates
php-ldap.x86_64 5.3.3-48.el6_8 updates
php-mbstring.x86_64 5.3.3-48.el6_8 updates
php-mysql.x86_64 5.3.3-48.el6_8 updates
php-odbc.x86_64 5.3.3-48.el6_8 updates
php-pdo.x86_64 5.3.3-48.el6_8 updates
php-pear.noarch 1:1.9.4-5.el6 base
php-pecl-apc.x86_64 3.1.9-2.el6 base
php-pecl-apc-devel.i686 3.1.9-2.el6 base
php-pecl-apc-devel.x86_64 3.1.9-2.el6 base
php-pecl-memcache.x86_64 3.0.5-4.el6 base
php-pgsql.x86_64 5.3.3-48.el6_8 updates
php-process.x86_64 5.3.3-48.el6_8 updates
php-pspell.x86_64 5.3.3-48.el6_8 updates
php-recode.x86_64 5.3.3-48.el6_8 updates
php-snmp.x86_64 5.3.3-48.el6_8 updates
php-soap.x86_64 5.3.3-48.el6_8 updates
php-tidy.x86_64 5.3.3-48.el6_8 updates
php-xml.x86_64 5.3.3-48.el6_8 updates
php-xmlrpc.x86_64 5.3.3-48.el6_8 updates
php-zts.x86_64 5.3.3-48.el6_8 updates
php56w-dba.x86_64 5.6.29-1.w6 webtatic
php56w-devel.x86_64 5.6.29-1.w6 webtatic
php56w-embedded.x86_64 5.6.29-1.w6 webtatic
php56w-enchant.x86_64 5.6.29-1.w6 webtatic
php56w-fpm.x86_64 5.6.29-1.w6 webtatic
php56w-imap.x86_64 5.6.29-1.w6 webtatic
php56w-interbase.x86_64 5.6.29-1.w6 webtatic
php56w-intl.x86_64 5.6.29-1.w6 webtatic
php56w-mcrypt.x86_64 5.6.29-1.w6 webtatic
php56w-mssql.x86_64 5.6.29-1.w6 webtatic
php56w-mysqlnd.x86_64 5.6.29-1.w6 webtatic
php56w-odbc.x86_64 5.6.29-1.w6 webtatic
php56w-opcache.x86_64 5.6.29-1.w6 webtatic
php56w-pear.noarch 1:1.10.1-1.w6 webtatic
php56w-pecl-apcu.x86_64 4.0.11-1.w6 webtatic
php56w-pecl-apcu-devel.x86_64 4.0.11-1.w6 webtatic
php56w-pecl-gearman.x86_64 1.1.2-1.w6 webtatic
php56w-pecl-geoip.x86_64 1.0.8-1.w6 webtatic
php56w-pecl-igbinary.x86_64 1.2.1-2.w6 webtatic
php56w-pecl-igbinary-devel.x86_64 1.2.1-2.w6 webtatic
php56w-pecl-imagick.x86_64 3.4.2-0.1.w6 webtatic
php56w-pecl-imagick-devel.x86_64 3.4.2-0.1.w6 webtatic
php56w-pecl-memcache.x86_64 3.0.8-2.w6 webtatic
php56w-pecl-memcached.x86_64 2.2.0-2.w6 webtatic
php56w-pecl-mongodb.x86_64 1.2.1-1.w6 webtatic
php56w-pecl-redis.x86_64 2.2.7-1.w6 webtatic
php56w-pecl-xdebug.x86_64 2.5.0-1.w6 webtatic
php56w-pgsql.x86_64 5.6.29-1.w6 webtatic
php56w-phpdbg.x86_64 5.6.29-1.w6 webtatic
php56w-process.x86_64 5.6.29-1.w6 webtatic
php56w-pspell.x86_64 5.6.29-1.w6 webtatic
php56w-recode.x86_64 5.6.29-1.w6 webtatic
php56w-snmp.x86_64 5.6.29-1.w6 webtatic
php56w-soap.x86_64 5.6.29-1.w6 webtatic
php56w-tidy.x86_64 5.6.29-1.w6 webtatic
php56w-xmlrpc.x86_64 5.6.29-1.w6 webtatic
已安装的是
php56w-mysql.x86_64 报错显然不对。
php-mysql.x86_64 安装这个包冲突错误。
php56w-mysqlnd.x86_64 选这个。
先卸载:
yum remove php56w-mysql-5.6.29-1.w6.x86_64
再安装mysqlnd:
yum -y install php56w-mysqlnd.x86_64
重启httpd:
service httpd restart
然后看到版本输出正常:
[root@nginx php.d]# php -version
PHP 5.6.29 (cli) (built: Dec 10 2016 13:02:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
再刷新 localhost/zabbix/setup
database support mysql ok.
解决。
以上是关于zabbix3.0 php56 PHP databases support fail的主要内容,如果未能解决你的问题,请参考以下文章
CentOS 6.8编译PHP 7.0.10安装Zabbix3.0.4