在 puphpet PHP 5.6 上找不到“SimpleXMLElement"类 [英] Class 'SimpleXMLElement' not found on puphpet PHP 5.6

查看:35
本文介绍了在 puphpet PHP 5.6 上找不到“SimpleXMLElement"类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经被这个错误困扰了好几个小时了,我似乎在互联网上找不到任何有用的信息.错误是经典

致命错误:找不到类SimpleXMLElement"/var/www/NavPHP/nav/plugin/log/NavLog.php 第 29 行

解决方案

问题是我使用的是 Cent OS,在这个 Linux 发行版中,php-libxml 包不是默认的.

我最终通过 PuPHPet GUI 生成了一台新机器,并将以下要安装的软件包添加到系统包中:

php-xml, php-simplexml

问题解决了.

<小时>

对于使用 PHP 7 和 Ubuntu 的用户,@MPS 通过运行 apt-get install php7.0-xmlservice apache2 restart 解决了这个问题.

在 Centos 上,我们需要安装 XML php 包.如果您使用的是 PHP 7.0 的 php70w 存储库

,您可以尝试 yum install php56w-xmlyum install php70w-xml

I've been stuck at this error for hours now and I can't seem to find anything useful on the internet about it. The error is the classic

Fatal error: Class 'SimpleXMLElement' not found in 
/var/www/NavPHP/nav/plugin/log/NavLog.php on line 29

I'm not using Namespace so that's not the problem.

It's a project that works fine in production and used to work in my former computer with WampServer and PHP 5.6.2. Now that I got a new computer, I'm interested in setting up a virtual environment with puphpet, but I'm getting this error.

According to Docs, the SimpleXMLElement class should come with PHP by default. I didn't find any important information on php.ini and in my phpinfo() there's the following:

SimpleXML   Sterling Hughes, Marcus Boerger, Rob Richards

Any tips?

Thanks

Update

Just to add this

解决方案

The problem was that I was using Cent OS and in this Linux Distribution, the php-libxml package does not come as default.

I ended up generating a new machine through PuPHPet GUI and added to the System Package the following packages to be installed:

php-xml, php-simplexml

Problem solved.


For those using PHP 7 and Ubuntu, @MPS solved it by running apt-get install php7.0-xml and service apache2 restart.

On Centos, we need to install the XML php package. You can try yum install php56w-xml or yum install php70w-xml if you're using php70w repository for PHP 7.0

这篇关于在 puphpet PHP 5.6 上找不到“SimpleXMLElement"类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆