Symfony app_dev.php install \DOMDomain错误 [英] Symfony app_dev.php install \DOMDomain error
问题描述
我在VMware播放器下的CentOS下的localhost上安装了Symfony。 (Windows 7,32位)
我的PHP版本是5.3.3。 CentOS是6.5。 VMware播放器是6.0.1。
I have installed Symfony on localhost under CentOS under VMware player. (Windows 7, 32 bit) My PHP version is 5.3.3. CentOS is 6.5. VMware player is 6.0.1.
当我尝试连接 localhost / Symfony / web / app_dev.php
我收到以下错误
When I attempt to connect with localhost/Symfony/web/app_dev.php
I get the following error
ClassNotFoundException:尝试从
/ b中的
全局命名空间加载类DOMDocument var / www / html / Symfony / vendor / symfony / symfony / src / Symfony / Component / Config / Util / XmlUtils.php
第47行。
ClassNotFoundException: Attempted to load class "DOMDocument" from the global namespace in /var/www/html/Symfony/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php line 47.
您是否忘记了此课程的使用声明?
Did you forget a use statement for this class?
第47行是
$dom = new \DOMDocument();
当我grepDOMDocument时,我得到102次点击。
I get 102 hits when I grep "DOMDocument".
大多数点击显示
$dom = new \DOMDocument();
或
$dom = new DOMDocument();
我以前在外部服务器上按照相同的脚本安装了Symfony,并且能够运行 app_dev.php
没有问题。 (FreeBSD)
I had previously installed Symfony on an external server following the same script and was able to exercise app_dev.php
without problem. (FreeBSD)
new \DOMDocument();
和之间有什么区别?新的DOMDocument();
。
我是一名JavaScript和PHP新手。有谁知道我应该怎么做才能纠正这个问题?或者有关如何解决问题的一些线索?
What is the difference between new \DOMDocument();
and new DOMDocument();
.
I am a JavaScript and PHP novice. Does anyone know what I should do to correct this ? or some clues as to how to trouble-shoot ?
推荐答案
在CentOS 6.5上运行 yum install php-xml 为我解决了这个问题。
Running yum install php-xml on CentOS 6.5 solved the problem for me.
这篇关于Symfony app_dev.php install \DOMDomain错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!