PHP 7.X 安装Zabbix 3.X问题解决

来源:互联网 发布:支付软件注册条件 编辑:程序博客网 时间:2024/06/05 06:59

安装好zabbix后,出现以下问题:
A non well formed numeric value encountered [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() → make_status_of_zbx() → CFrontendSetup->checkRequirements() → CFrontendSetup->checkPhpMemoryLimit() → str2mem() in include/func.inc.php:410]
A non well formed numeric value encountered [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() → make_status_of_zbx() → CFrontendSetup->checkRequirements() → CFrontendSetup->checkPhpPostMaxSize() → str2mem() in include/func.inc.php:410]
A non well formed numeric value encountered [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CView->getOutput() → include() → make_status_of_zbx() → CFrontendSetup->checkRequirements() → CFrontendSetup->checkPhpUploadMaxFilesize() → str2mem() in include/func.inc.php:410]

这里写图片描述

安装完成之后启动就出现这个问题,这个是因为PHP 7.X类型强化,处理方法也很简单找到zabbix 安装目录下zabbix/include/func.inc.php文件

[root@linux-node3 include]# pwd/home/wwwroot/zabbix/include[root@linux-node3 include]# cp func.inc.php func.inc.php.bak [root@linux-node3 include]# sed -i '/$last = strtolower(substr($val, -1));/a$val = substr($val,0,-1);' func.inc.php

修改完后,刷新页面,效果如下:

这里写图片描述

备注:
如果有一下报错

zabbix server is not running:the information displayed may not be current

一般是由于php.ini文件的fsockopen模块没有启动的问题
启用fsockopen模块的方法:

php.ini文件中查找allow_url_fopen = On   #改为Onextension=php_openssl.dll    #去掉分号,如果去掉分号重启php有警告,可以编译openssl模块
原创粉丝点击