Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Cannot send headers; headers already sent
 
AnneLise
Sr. Member
 
Avatar
Total Posts:  154
Joined:  2008-09-08
Bergen, Norway
 

Toady, all of a sudden, customers can no longer place orders on my live site. 
Whenever trying to add products to the cart, the ”There has been an error processing your request” page pops up.

The error is:

Cannot send headers; headers already sent in /home/x/x/mydomain/www/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php, line 242

The only thing my “line 242” says is: 

}

What in the world is wrong with my Magento store??  I feel like there is popping up critical problems at least once a week :(

PLease help.. anyone?

//Lise

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Does it happen on all products or only those with selectable options?

 
Magento Community Magento Community
Magento Community
Magento Community
 
AnneLise
Sr. Member
 
Avatar
Total Posts:  154
Joined:  2008-09-08
Bergen, Norway
 

Hmm.... whenever I post a problem, the solution seems to magically pop up about 3 seconds after.

If anyone experiences the same problem (headers already sent) - whatever file in the end - the problem is white spaces in the PHP code.

Follow the error by opening the relevant file - look at the row number, and look for white spaces.  Use a differend editor then you usually use (I use EditPlus, which is great!).
Delete the white spaces, save and upload the file.

After I did this, the same problem popped up, but now naming a different file.  I looked for white spaces in this file as well, deleted them, and now the store is back to normal.

Hope this can help others with the same problem.

FOr the record, I use Magento 1.3.2.3

//Lise

 
Magento Community Magento Community
Magento Community
Magento Community
 
AnneLise
Sr. Member
 
Avatar
Total Posts:  154
Joined:  2008-09-08
Bergen, Norway
 

J.T. , always so quick with your replies grin

It only happened to the products with options, regardless of whether they were required or not.

//Lise

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

OK, glad you fixed it.

Did it happen after a recent upgrade perhaps?

I’m a bit behind, on 1.3.1.1 so keeping an eye on what may go wrong. Always used Diff without problems but I can see how white space may creep in.

 
Magento Community Magento Community
Magento Community
Magento Community
 
AnneLise
Sr. Member
 
Avatar
Total Posts:  154
Joined:  2008-09-08
Bergen, Norway
 

Upgraded about a week ago, and until now everything has been working great..  So strange how these things happen by themselves sometimes.
The only recent thing I’ve done, is added a discount coupon, and that shouldn’t be enough to trigger white spaces in different files ...?

I hate upgrading Magento.. I’m not going to do it again unless the store crashes (again!!).

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

That sure is weird.

Before an upgrade, I always take a full file + DB backup. If anything messes up, with Beyond Compare I can quickly see what’s wrong by comparing the two, or by comparing the new version with a fresh download. Highly recommended.

Another idea may be to ditch IDEs and go with vim for CLI file editing. At least you’ll know that it’s not the IDE messing things up.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top