2015-06-15 41 views
1

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

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} 

回答

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可能是你正在寻找的。

+1

你救了我的命,先生,谢谢!原来,Magento在XML文件的开始标记后面添加了一个空格,这就是问题所在。在您的帮助下,我能够找到有问题的文件并修复它。再次感谢! :) –