当前位置: 代码迷 >> 综合 >> lnmp环境下zabbix安装时显示php databases support off 报错解决
  详细解决方案

lnmp环境下zabbix安装时显示php databases support off 报错解决

热度:59   发布时间:2023-10-13 00:52:35.0

文章目录

    • 报错展示
    • 解决方法
      • 方法一
      • 方法二
      • 问题已解决

报错展示

lnmp环境下zabbix安装时显示php databases support off 报错解决

解决方法

方法一

在编译安装php的时候加入--with-mysqli参数,没有此参数无法和数据库想连接
这是我自己的编译参数如下

./configure \
--prefix=/application/php5.6.36 \
--with-mysql=/application/mysql/ \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-mysqli  \  ##没有此项无法连接数据库
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp \
--enable-opcache=no

方法二

安装依赖问题,使用yum进行安装

yum install -y php-mysql.x86_64

安装完成后重启MySQL和httpd/nginx服务

问题已解决

lnmp环境下zabbix安装时显示php databases support off 报错解决

  相关解决方案