As it turns out, I keep on sharing the OpenCart errors that I come across every day. Well, I suppose that I’d like to save people the frustration and infinite reading on the problems that I’ve already got solved. So, I present to you OpenCart error of the week
Warning: Cannot modify header information – headers already sent by (output started at ...) in ... on line ...
This is mostly intended for not-so-tech people, who are in a hurry to solve their OpenCart problem. That’s why I will not get into the “Why” of the problem, but the “How”.
Tools you need
- First, let’s Look closely at the error message:
Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/catalog/language/thai/payment/bank_transfer.php:1) in/home/mywebsite/public_html/vqmod/vqcache/vq2-system_engine_controller.php
Surely, you have noticed the pattern.
- Now, it’s time to hunt down that file. You need to open the file
in the text editor.
- At the very beginning of the file, look for white spaces, like this
and remove them.
<must be the first symbol at the beginning of the file
- Look for white spaces at the end of the file, like this
>must be the last symbol at the end the file.
- Then go to File->Save As… and choose UTF8 without BOM for encoding.
- Reupload the file in ASCII mode.
If this doesn’t solve the problem, it can be a conflicting vQmod extension. Disable all extensions and see when the problem appears again.
Still no luck?
Well, then I suppose you can dive in the sea of other solutions. These are nice guides: