Magento simplexml_load_string()错误位置

时间:2015-06-15 09:57:51

标签: php xml magento

我有一个非常讨厌的问题。当我遇到simplexml_load_string()错误时,我正在对Magento商店进行一些更改,我很清楚这个错误是由一些错误的XML文件引起的,但对我来说非常重要的问题是哪个文件及其位于何处? 这是我收到的错误消息,我从未非常善于理解这些控制台类型的消息,有人可以帮助我吗?

Warning: simplexml_load_string(): Entity: line 1: parser error : StartTag: invalid element name  in /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php on line 450

#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/var/www/html/a...', 450, Array)
#1 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(450): simplexml_load_string('< ?xml version=...', 'Mage_Core_Model...')
#2 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(275): Mage_Core_Model_Layout_Update->getFileLayoutUpdatesXml('frontend', 'MyTheme', 'Responsive', '1')
#3 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(347): Mage_Core_Model_Layout_Update->fetchFileLayoutUpdates()
#4 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(246): Mage_Core_Model_Layout_Update->fetchPackageLayoutUpdates('default')
#5 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(224): Mage_Core_Model_Layout_Update->merge('default')
#6 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(306): Mage_Core_Model_Layout_Update->load()
#7 /var/www/html/app/code/core/Mage/Cms/Helper/Page.php(109): Mage_Core_Controller_Varien_Action->loadLayoutUpdates()
#8 /var/www/html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'about-magento-d...')
#9 /var/www/html/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'about-magento-d...')
#10 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#11 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /var/www/html/index.php(91): Mage::run('', 'store')
#16 {main}

1 个答案:

答案 0 :(得分:6)

这是与/var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php相关的内容所以我会编辑该文件,然后我会转到第450行。

在该行之前写下:

Mage::log(print_r($filename, true));

确保已启用日志记录并刷新页面。之后,看看var / log / system.log。最后一个xml可能就是你要搜索的内容。