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.

  • Check your htaccess file.
    – Keyul Shah
    Commented Dec 21, 2013 at 6:29
  • It's generally caused by outputting some text to the screen before any other headers are sent. Check for echos or prints that you've placed for testing purposes Commented Dec 21, 2013 at 8:37
  • @KeyulShah nothing in htaccess file Commented Dec 21, 2013 at 9:08
  • @SanderMangel there is nothing, no echos or prints..:( Commented Dec 21, 2013 at 9:09

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.