3
Entity: line 60: parser error : Opening and ending tag mismatch: config line 28 and confg  in /home/theprint/public_html/lib/Varien/Simplexml/Config.php

当我尝试清理 magento 缓存并启用在 index.php 上打印错误时会发生此异常,如果我在 index.php 上没有此行,则它可以正常工作

if ($_SERVER['REMOTE_ADDR'] == '83.134.115.xxx') { Mage::setIsDeveloperMode(true); ini_set('display_errors', 1); }


Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 60: parser error : Opening and ending tag mismatch: config line 28 and confg  in /home/theprint/public_html/lib/Varien/Simplexml/Config.php on line 510

#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/home/theprint/...', 510, Array)
#1 /home/theprint/public_html/lib/Varien/Simplexml/Config.php(510): simplexml_load_string('loadString('loadFile('/home/theprint/...')
#4 /home/theprint/public_html/app/code/core/Mage/Admin/Model/Config.php(59): Mage_Core_Model_Config->loadModulesConfiguration('adminhtml.xml', Object(Varien_Simplexml_Config))
#5 /home/theprint/public_html/app/code/core/Mage/Core/Model/Config.php(1351): Mage_Admin_Model_Config->__construct(Array)
#6 /home/theprint/public_html/app/Mage.php(432): Mage_Core_Model_Config->getModelInstance('admin/config', Array)
#7 /home/theprint/public_html/app/Mage.php(446): Mage::getModel('admin/config', Array)
#8 /home/theprint/public_html/app/code/core/Mage/Adminhtml/Block/Page/Menu.php(124): Mage::getSingleton('admin/config')
#9 /home/theprint/public_html/app/code/core/Mage/Adminhtml/Block/Page/Menu.php(89): Mage_Adminhtml_Block_Page_Menu->_buildMenuArray()
#10 /home/theprint/public_html/app/design/adminhtml/default/default/template/page/menu.phtml(32): Mage_Adminhtml_Block_Page_Menu->getMenuArray()
#11 /home/theprint/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/theprint/...')
#12 /home/theprint/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#13 /home/theprint/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /home/theprint/public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#15 /home/theprint/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Template->_toHtml()
#16 /home/theprint/public_html/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#17 /home/theprint/public_html/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('menu', true)
#18 /home/theprint/public_html/app/design/adminhtml/default/default/template/page.phtml(53): Mage_Core_Block_Abstract->getChildHtml('menu')
#19 /home/theprint/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/theprint/...')
#20 /home/theprint/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#21 /home/theprint/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#22 /home/theprint/public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#23 /home/theprint/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Template->_toHtml()
#24 /home/theprint/public_html/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#25 /home/theprint/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(391): Mage_Core_Model_Layout->getOutput()
#26 /home/theprint/public_html/app/code/core/Mage/Adminhtml/controllers/CacheController.php(48): Mage_Core_Controller_Varien_Action->renderLayout()
#27 /home/theprint/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Adminhtml_CacheController->indexAction()
#28 /home/theprint/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#29 /home/theprint/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#30 /home/theprint/public_html/app/code/core/Mage/Core/Model/App.php(347): Mage_Core_Controller_Varien_Front->dispatch()
#31 /home/theprint/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#32 /home/theprint/public_html/www.theprinterdepo.com/index.php(55): Mage::run('printerdepo', 'website')
#33 {main}
4

2 回答 2

5

安装中的adminhtml.xml模块配置文件之一包含无效的 XML。如果您无法确定是哪一个,请转到第 5101 行

/home/theprint/public_html/lib/Varien/Simplexml/Config.php

并在调用周围添加一些调试代码,以simplexml_load_string使 PHPvar_dump成为完整路径。那应该指向非格式良好的 XML 文件。

于 2012-10-02T19:36:35.207 回答
1

将公共函数 loadString($string) 更改如下。检查行号 510

公共函数加载字符串($字符串)

{
    if (is_string($string)) {
        // Enable internal errors
        libxml_use_internal_errors(true);
        $xml = simplexml_load_string($string, $this->_elementClass);
        if (false === $xml) {
            // Put breakpoint here
            $errors = libxml_get_errors();
        }
        if ($xml instanceof Varien_Simplexml_Element) {
            $this->_xml = $xml;
            return true;
        }
    } else {
        Mage::logException(new Exception('"$string" parameter for simplexml_load_string is not a string'));
    }
    return false;
}
于 2013-08-13T07:07:46.137 回答