升级到PHP 7禁用了CentOS中的SimpleXML mod

时间:2017-05-25 07:55:11

标签: centos simplexml php-7

我需要在CentOS中启用PHP7上的SimpleXML mod。

在我的ubuntu服务器上,它就像

一样简单
sudo apt-get install php7.0-xml

知道如何在centOS上做到这一点吗?

我尝试安装webtatic和epel-release软件包,但由于某种原因,它们搞砸了yum,每次执行yum都会产生“xz compression not supported”错误。

还有其他想法吗?

1 个答案:

答案 0 :(得分:1)

最后用remi的存储库找到了解决方案

通过为您的系统下载相应的RPM软件包并安装它来安装Remi存储库。

CentOS和Red Hat Enterprise Linux 6.x

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm

CentOS和Red Hat Enterprise Linux 7.x

wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo rpm -Uvh remi-release-7*.rpm

如果在尝试下载程序包时收到“找不到文件”错误消息,则版本号可能已更改。您可以从Remi Repository配置页面访问最新版本的RPM安装程序。

默认情况下,在添加它们之后,我的默认情况下禁用了remi,所以我按照以下方式启用它们以再次更新PHP

yum --enablerepo=remi,remi-php70 install php70 php-common

重启apache

apachectl restart

SimpleXML模块现在也可以在

中看到
  $php -m