php bin / magento setup:upgrade给出错误(localhost ubuntu 16.04)

时间:2017-04-08 14:43:01

标签: dom magento2

PHP bin / Magento模块:状态

我正在制作磁性简易自定义模块但是给我以下错误。

    user@user:/opt/lampp/htdocs/magento2$ php bin/magento module:status 
PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php:364
Stack trace:
#0 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php(109): Magento\Framework\Config\Dom->_initDom('<?xml version="...')
#1 /opt/lampp/htdocs/magento2/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): Magento\Framework\Config\Dom->__construct('<?xml version="...', Object(Magento\Framework\App\Arguments\ValidationState), Array, 'xsi:type', NULL)
#2 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Reader/Filesystem.php(146): Magento\Framework\ObjectManager\Config\Reader\Dom->_createConfigMerger('Magento\\Framewo...', '<?xml version="...')
#3 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#4 /opt/lampp/htdocs/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(269): Magento\Framework\Config in /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php on line 364

我甚至使用下面的命令安装了dom 重新启动apache2但同样的错误/ usser @ user:/ opt / lampp / htdocs / magento2 $ sudo apt-get install php5.6-dom

1 个答案:

答案 0 :(得分:0)

请您使用以下命令删除生成的文件后尝试setup:upgrade命令。

rm -rf var / di var / generation var / cache var / page_cache var / view_preprocessed

问题可能不在于Dom。