首页 > 解决方案 > 错误:magento 模板安装期间的 Dom.php 问题

问题描述

我一直在尝试将新模板安装到新的 magento 实例中,但是一旦我部署了新模板,我就会在前端收到:

“处理您的请求时出错”

这甚至在启用模板之前,因此安装包中的某些内容会导致问题。后端工作正常,但显示的内容 > 页面除外。

Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/sitename/public_html/vendor/magento/framework/Config/Dom.php on line 451

该报告给出了以下信息:

{"0":"Warning: DOMDocument::loadXML(): Empty string supplied as input in \/home\/sitename\/public_html\/vendor\/magento\/framework\/Config\/Dom.php on line 451","1":"<pre>#1 DOMDocument->loadXML('') called at [vendor\/magento\/framework\/Config\/Dom.php:451]\
n#2 Magento\\Framework\\Config\\Dom->_initDom('') called at [vendor\/magento\/framework\/Config\/Dom.php:148]\
n#3 Magento\\Framework\\Config\\Dom->merge('') called at [vendor\/magento\/framework\/Config\/Reader\/Filesystem.php:153]\
n#4 Magento\\Framework\\Config\\Reader\\Filesystem->_readFiles(&Magento\\Framework\\Config\\FileIterator#000000003e734d8c00000000059727da#) called at [vendor\/magento\/framework\/Config\/Reader\/Filesystem.php:132]\
n#5 Magento\\Framework\\Config\\Reader\\Filesystem->read('frontend') called at [generated\/code\/Magento\/Framework\/App\/Route\/Config\/Reader\/Proxy.php:95]\
n#6 Magento\\Framework\\App\\Route\\Config\\Reader\\Proxy->read('frontend') called at [vendor\/magento\/framework\/App\/Route\/Config.php:92]\
n#7 Magento\\Framework\\App\\Route\\Config->_getRoutes('frontend') called at [vendor\/magento\/framework\/App\/Route\/Config.php:136]\
n#8 Magento\\Framework\\App\\Route\\Config->getModulesByFrontName('cms') called at [vendor\/magento\/framework\/App\/Router\/Base.php:280]\
n#9 Magento\\Framework\\App\\Router\\Base->matchAction(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#, array('moduleFrontName' => 'cms', 'actionPath' => NULL, 'actionName' => NULL)) called at [vendor\/magento\/framework\/App\/Router\/Base.php:167]\
n#10 Magento\\Framework\\App\\Router\\Base->match(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/framework\/App\/FrontController.php:95]\
n#11 Magento\\Framework\\App\\FrontController->dispatch(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\
n#12 Magento\\Framework\\App\\FrontController\\Interceptor->___callParent('dispatch', array(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#)) called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\
n#13 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/module-store\/App\/FrontController\/Plugin\/RequestPreprocessor.php:94]\
n#14 Magento\\Store\\App\\FrontController\\Plugin\\RequestPreprocessor->aroundDispatch(&Magento\\Framework\\App\\FrontController\\Interceptor#000000003e73484900000000059727da#, &Closure#000000003e734f2900000000059727da#, &Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\
n#15 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/module-page-cache\/Model\/App\/FrontController\/BuiltinPlugin.php:69]\
n#16 Magento\\PageCache\\Model\\App\\FrontController\\BuiltinPlugin->aroundDispatch(&Magento\\Framework\\App\\FrontController\\Interceptor#000000003e73484900000000059727da#, &Closure#000000003e734f2900000000059727da#, &Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\
n#17 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\
n#18 Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins('dispatch', array(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#), NULL) called at [generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php:26]\
n#19 Magento\\Framework\\App\\FrontController\\Interceptor->dispatch(&Magento\\Framework\\App\\Request\\Http#000000003e734b3e00000000059727da#) called at [vendor\/magento\/framework\/App\/Http.php:137]\
n#20 Magento\\Framework\\App\\Http->launch() called at [generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php:24]\
n#21 Magento\\Framework\\App\\Http\\Interceptor->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:261]\
n#22 Magento\\Framework\\App\\Bootstrap->run(&Magento\\Framework\\App\\Http\\Interceptor#000000003e734a2d00000000059727da#) called at [index.php:39]\n<\/pre>","url":"\/","script_name":"\/index.php"}

不确定如何准确解释这一点。有谁知道可能是什么问题?

标签: phpxmlmagento2

解决方案


解决了

两个文件未能正确上传,留下一个 0kb 的文件

contact_index_index.xml

路由.xml


推荐阅读