当zabbix 2.4/2.5 搭配php7 出现 always_populate_raw_post_data 报警无法安装的解决办法

当zabbix 2.4/2.5 搭配php7 出现 always_populate_raw_post_data 报警无法安装的解决办法

when you install zabbix 2.4/2,5 with php7 ,you will meet the alert of  always_populate_raw_post_data xxxx.In fact php 7 already removed this function.So we need to make some modify to slove this problem.

本方法适用于YUM安装的

This solution is suit for yun/rpm installion.

打开/usr/share/zabbix/include/classes/setup/CFrontendSetup.php

open /usr/share/zabbix/include/classes/setup/CFrontendSetup.php

找到这一段

// check for deprecated PHP 5.6.0 option 'always_populate_raw_post_data'
               if (version_compare(PHP_VERSION, '5.6', '>=')) {

修改成这样

  if (version_compare(PHP_VERSION, '5.6', '>=') && version_compare(PHP_VERSION, '7.0.0alpha2', '<')) {
                        $result[] = $this->checkPhpAlwaysPopulateRawPostData();
                }
                $result[] = $this->checkPhpSockets();

就可以了

https://support.zabbix.com/browse/ZBX-9659

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据