ERROR: Class 'DOMDocument' not found

ERROR: Class 'DOMDocument' not found


我使用的是 Centos 7,PHP7.0.14

我第一次 运行 codeception 然后我收到一条错误消息说

测试tests/acceptance/WelcomeCept.php
[错误] Class 'DOMDocument' 未找到

看到很多推荐 php-xml 的帖子,可惜对我来说不太管用。

下面是我得到的错误!
错误:包:php-xml-5.4.16-42.el7.x86_64 (base)
要求:php-common(x86-64) = 5.4.16-42.el7
已安装:php-common-7.0.14-1.el7.remi.x86_64 (@remi-php70)
php-普通(x86-64) = 7.0.14-1.el7.remi
可用:php-common-5.4.16-42.el7.x86_64(基础)
php-普通(x86-64) = 5.4.16-42.el7

有人可以帮忙吗?
如果在解决方案中包含原因就更好了!
谢谢! :)

你需要 dom 扩展,因为你已经从 remi-php70 存储库安装了 PHP 7.0,你需要拉这个来自同一存储库的扩展。

yum --enablerepo=remi-php70 install php-dom

永久启用此存储库以避免将来出现此类问题并利用即将推出的版本可能更简单

yum-config-manager --enable remi-php70
yum install php-dom

Wizard 所述。