大家好,我收到一个似乎无法修复的错误。
a:5:{i:0;s:93:"Cannot send headers; headers already sent in /home/exowear/public_html/app/Mage.php, line 766";i:1;s:1013:"#0 /home/exowear/public_html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/exowear/public_html/app/code/core/Mage/Core/Model/App.php(1246): Zend_Controller_Response_Abstract->setHeader('Content-Type', 'text/html; char...')
#2 /home/exowear/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(80): Mage_Core_Model_App->getResponse()
#3 /home/exowear/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(202): Mage_Core_Controller_Varien_Front->getResponse()
#4 /home/exowear/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))
#5 /home/exowear/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/exowear/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /home/exowear/public_html/index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:10:"/index.php";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
我正在尝试在实时域上设置它,但我一直遇到这个问题。它在我的测试服务器上运行良好。http://mytempsite.net/sin但是当我把它带到http://vegassinexoticwear.com时,我得到了这个错误。
我试过的
- 我备份了我的临时站点上的整个目录,并使用 SSH 将它带到了新服务器上。然后我导出数据库并将其导入新数据库。更改 core_config_data 表中的 URL。清除缓存,甚至检查权限。
- 我安装了一个新的 magento 副本,并分别带来了应用程序、皮肤和媒体文件夹。在把它拿过来之前没有错误,但是一旦我把 app 文件夹拿过来,我又遇到了这个错误。
为什么它可以在一台服务器上运行,而不能在另一台服务器上运行?
编辑/附加细节 这是我在尝试访问该站点时没有得到的错误。
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 4: parser error : StartTag: invalid element name in /home/exowear/public_html/sin/lib/Varien/Simplexml/Config.php on line 510
#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/home/exowear/p...', 510, Array)
#1 /home/exowear/public_html/sin/lib/Varien/Simplexml/Config.php(510): simplexml_load_string('loadString('loadFile('/home/exowear/p...')
#4 /home/exowear/public_html/sin/app/code/core/Mage/Core/Model/Config.php(315): Mage_Core_Model_Config->_loadDeclaredModules()
#5 /home/exowear/public_html/sin/app/code/core/Mage/Core/Model/App.php(414): Mage_Core_Model_Config->loadModules()
#6 /home/exowear/public_html/sin/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#7 /home/exowear/public_html/sin/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#8 /home/exowear/public_html/sin/index.php(87): Mage::run('', 'store')
#9 {main}
当我去查看 Config.php 第 510 行时,这就是那里
$xml = simplexml_load_string($string, $this->_elementClass);
整个功能是这样的
*/
public function loadString($string)
{
if (is_string($string)) {
$xml = simplexml_load_string($string, $this->_elementClass);
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;
}
我的 local.xml 文件已保存,确保在 DW CS6 中未选中 BOM
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Magento
*
* NOTICE OF LICENSE ......
-->
<config>
<global>
<install>
<date><![CDATA[Mon, 10 Jun 2013 16:34:40 +0000]]></date>
</install>
<crypt>
<key><![CDATA[9a38bb0fba550a5d295b3789fe2dafee]]></key>
</crypt>
<disable_local_modules>false</disable_local_modules>
<resources>
<db>
<table_prefix><![CDATA[]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[usernamehere]]></username>
<password><![CDATA[passwordhere]]></password>
<dbname><![CDATA[dbnamehere]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>
</default_setup>
</resources>
<session_save><![CDATA[files]]></session_save>
</global>
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
</config>