手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2016年10月13日的文章

PHP 7 DomDocument not found

 升到PHP7后,当用到DomDocument的时候,报错说class DomDocument not found。。。

用php -m|grep xml,可以看到libxml是被加载的。
 
根据官方文档:
XML/HTML代码
  1. This extension requires the libxml PHP extension. This means that passing in --enable-libxml is also required, although this is implicitly accomplished because libxml is enabled by default.  
证明没有错。
事实上也有很多人遇到了这个问题,怎么破?对于我用apt-get install的人来说,实在太方便了。
直接:
apt-get install php7.0-xml
搞定。
 
参考:http://stackoverflow.com/questions/35668702/php-7-domdocument-not-found