PHP: nginx+php部署zabbix,安装界面显示缺失php模块

nginx+php部署zabbix,安装界面显示缺失php模块

承接上一文章,解决了无法访问安装界面之后,又出现了以下问题:
在这里插入图片描述
图中提示的是缺少了很多php的扩展模块,如果你的php是编译安装的,编译时已经添加了这些模块,那应该不会出现这种问题;又或者你的php用的是zabbix提供的那一套apache+php,应该也不会出现这个问题。我的php是根据上两篇文章,用yum安装的,估计是没有这些模块的。

  • 检查yum源是否含有这些模块的包
[root@zabbix-server web]# yum provides *bcmath*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * centos-sclo-rh: mirrors.163.com
 * centos-sclo-sclo: mirrors.163.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
 * webtatic: uk.repo.webtatic.com
php-bcmath-5.4.16-48.el7.x86_64 : A module for PHP applications for using the bcmath library
Repo        : base
Matched from:
Other       : php-bcmath = 5.4.16-48.el7
Filename    : /etc/php.d/bcmath.ini
Other       : php-bcmath(x86-64) = 5.4.16-48.el7
Filename    : /usr/lib64/php/modules/bcmath.so
Filename    : /usr/share/doc/php-bcmath-5.4.16
Filename    : /usr/share/doc/php-bcmath-5.4.16/libbcmath_COPYING



php-ezc-Authentication-1.3.1-9.el7.noarch : Support for different means of identification and authentication
Repo        : epel
Matched from:
Filename    : /usr/share/pear/ezc/Authentication/math/bcmath_library.php



php55w-bcmath-5.5.38-1.w7.x86_64 : A module for PHP applications for using the bcmath library
Repo        : webtatic
Matched from:
Other       : php55w-bcmath(x86-64) = 5.5.38-1.w7
Other       : php-bcmath(x86-64) = 5.5.38-1.w7
Other       : php55w-bcmath = 5.5.38-1.w7
Filename    : /etc/php.d/bcmath.ini
Other       : php-bcmath = 5.5.38-1.w7
Filename    : /usr/lib64/php-zts/modules/bcmath.so
Filename    : /etc/php-zts.d/bcmath.ini
Filename    : /usr/lib64/php/modules/bcmath.so
Filename    : /usr/share/doc/php55w-bcmath-5.5.38
Filename    : /usr/share/doc/php55w-bcmath-5.5.38/libbcmath_COPYING

以bcmath为例,发现确实是有相关的包,选一个跟php版本对应的包,安装上去,重启php,回到界面,发现bcmath这个模块还是提示缺少的。

网上很多教程都说要重新编译,加模块,但是我这个是yum安装的,显然不适用那些方法,最后在研究配置文件的过程中,发现了添加模块的方法。

  • 找到扩展文件
[root@zabbix-server web]# find / -name bcmath.so
find: ‘/proc/99944’: No such file or directory
/opt/rh/rh-php72/root/usr/lib64/php/modules/bcmath.so
  • 编辑 /etc/php.ini文件
    在这里插入图片描述
    如上图,写入具体文件的位置,图中是我已经全部加好的结果,有些文件还要装相应的包,就根据提示,像我上面的方法去找包即可。需要注意的是,有些缺失的模块,不仅仅是添加一个so文件就行了,要添加全,才会满足安装界面上的要求。

添加完毕,重启php即可。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值