After building the LNMP architecture, use yum to install Zabbix server, web front-end, and the agent starts reporting errors: Need: php-mbstring/php-bcmath extension module support

①Fault phenomenon

surroundings:

  1. Build Zabbix monitoring based on LNMP architecture
  2. Zabbix:4.0 LTS
  3. VMware Workstation 16 / CentOS 7

After I built the LNMP architecture, when I started yum to install Zabbix server, Web front-end, and agent, the following error occurred:

rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm

yum clean all

yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent
...
...
错误:软件包:zabbix-web-4.0.29-1.el7.noarch (zabbix)
          需要:php-mbstring
错误:软件包:zabbix-web-4.0.29-1.el7.noarch (zabbix)
          需要:php-bcmath
 您可以尝试添加 --skip-broken 选项来解决该问题
 您可以尝试执行:rpm -Va --nofiles --nodigest

②Solution ideas

Follow the error prompt

yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent --skip-broken
#笔者这里添加后执行,跳过了(依赖问题),治标不治本

rpm -Va --nofiles --nodigest
#执行完该命令后继续安装,继续报错

Baidu looked for it and learned:

  1. This is because Zabbix has special requirements for PHP parameters and modules. Zabbix cannot be installed here because of the lack of PHP extensions.
  2. This problem will occur if the php version and php configuration parameters of the native system do not match the zabbix version
  3. Use online YUM source to solve , my previous environment is local YUM source, can provide php extension modules php-bcmath and php-mbstring
//配置阿里云在线YUM源仓库:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

cd /etc/yum.repos.d/
mv local.repo repos.bak/

yum clean all && yum makecache fast

--
//再来重新试一把
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
yum clean all

yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
mark

Guess you like

Origin blog.csdn.net/weixin_51486343/article/details/114996943