Another day I stay up late at night to solve client’s problems on Magento. Another day I learn something new about Magento, help people, find great tips and have a great feeling about myself that I have solved one more challenge.
In this article I will show you quick tip that will help you solve common problems in Magento: “Can’t send header. Header already sent” in Magento.
My client’s store doesn’t have a root category and that’s the problem I need to solve. While I was emailing him back and forth, I discovered that his store was not there any more. Oops! When I asked, the client said he had added a new store and when he did something in the admin, the store gone as well as the admin backend.
Lesson that I learned and I think it’s also a good practice for you is always backup your data before you do any changes.
Quick tip for “Can’t send header. Header is already sent” in Magento
I got this error when I have managed to bring back the client store. Basically, this error happens when there is an extra space or character outside the the php tag <?php and ?>. Thanks to the help of excellent Magento users, I have been able to solve it. I think it will be useful if I explained steps by steps what I personally have done so that you can reference it later. When this error happens, you should try the following things.
- Open the file that has the problem. In my case, this file is index.php in the site root of Magento.
- Open the file with some text editors that supports the encoding. I prefer Notepad++ because its great support in multi languages as well as encoding.
- If you open it by Notepad++, click on the menu Encoding, click on UTF-8 without BOM. Save it and then re-upload it to the server.
We just save the error file in the UTF-8 encoding to make sure that everything extra space, line is wiped out. Encoding without BOM ensures you will not have any extra, unwanted characters in the file that prevent it from being executed properly.
6 Responses to Quick tip to solve “Can’t send header” in Magento
Leave a Reply







Thanks a lot. This solved my problem in a flash!
Wrong !!
this problem is based on “cache”.
i have multiple site on server. and i run on ZendServer.
this issue is because of “data cache” on ZendServer. (or other cache mechism)
i cleard data cache of ZendServer. and this is solved every time.
YOUR WRONG !!
The Solution is to “CLEAR” the cache. (NOT magento cache management, you are using caching system. ex) ZendServer, memcached….etc…and so on…)
You seemed to be solved because of re-upload issued file.
therefore, cache system is refreshed automatically.
Finally, This problem’s cause is CACHED DATA !!!!!
(either you are re-upload the file or you are refresh the cache)
Yeah, you need to clear the cache. Didn’t I mention you need to delete everything in the cache folder? You can’t use the cache management because this error will prevent you from logging into the backend
Really? I never test Magento on Zend Server but I will do.
My problem with Cannot send headers; headers already sent in /home/public_html/app/code/core/Mage/Sales/Model/Order.php, line 1 not resolved.
Can anyone help me?