When I go to my website I receive the following error (I downloaded this error file from the var folder):
a:5:{i:0;s:88:\"Cannot send headers; headers already sent in
/home/eyewear/public_html/index.php, line 1\";i:1;s:943:\"#0
/home/eyewear/public_html/lib/Zend/Controller/Response/Abstract.php(115):
Zend_Controller_Response_Abstract->canSendHeaders(true)#1 /home/eyewear/public_html/app/code/core/Mage/Core/Model/App.php(1246):
Zend_Controller_Response_Abstract->setHeader(\’Content-Type\’,
\’text/html; char…\’)#2 /home/eyewear/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(80):
Mage_Core_Model_App->getResponse()#3 /home/eyewear/public_html/app/code/core/Mage/Core/Model/Url/Rewrite.php(204):
Mage_Core_Controller_Varien_Front->getResponse()#4 /home/eyewear/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(166):
Mage_Core_Model_Url_Rewrite->rewrite()#5 /home/eyewear/public_html/app/code/core/Mage/Core/Model/App.php(354):
Mage_Core_Controller_Varien_Front->dispatch()#6 /home/eyewear/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /home/eyewear/public_html/index.php(105): Mage::run(\’\’, \’store\’)
#8 {main}\”;s:3:\"url\”;s:1:\"/\”;s:11:\"script_name\”;s:10:\"/index.php\”;s:4:\"skin\”;s:7:\"default\";}
Before I got this error, I was optimizing the website by minifying CSS and one .js file. This error occurred soon after, so I reverted back to original unminified js and the error still remains.
Any help would be much appreciated.
Best Answer
Check for anything in all files, before the starting
<?php
and if the file ends with an?>
. Remove the trailing?>
. No one needs this.This error is often raised, because you added a space before the stating
<?php
And I think in later PHP versions, they improved the error by adding the information where the output started. Think about updating php to know this.