{"id":14095,"date":"2013-01-19T02:35:26","date_gmt":"2013-01-19T07:35:26","guid":{"rendered":"http:\/\/info.template-help.com\/?p=14095"},"modified":"2017-02-22T03:32:28","modified_gmt":"2017-02-22T08:32:28","slug":"troubleshooter-cannot-add-header-information-headers-already-sent","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/troubleshooter-cannot-add-header-information-headers-already-sent.html","title":{"rendered":"Troubleshooter. Cannot add header information &#8211; headers already sent"},"content":{"rendered":"<p>\r\n<p>This tutorial shows how to resolve the issue causing the &quot;Cannot add header information &#8211; headers already sent&quot; error message. <\/p>\r\n<p><!--more--><br \/>\r\n  Here are other variants of this problem:<br \/>\r\n  <strong>Warning: Cannot send session cookie &#8211; headers already sent<\/strong><br \/>\r\n  <strong>Warning: Cannot send session cache limiter &#8211; headers already sent<\/strong><\/p>\r\n<p>  It often occurs in WordPress, osCommerce, Drupal and VirtueMart templates and signalizes about<br \/>\r\n  an empty space or line in the file.<\/p>\r\n<p><strong>Solution:<\/strong><\/p>\r\n<p>  For instance, if you are getting an error similar to this<\/p>\r\n<p> <em><strong>Warning: session_start() [function.session-start]: Cannot send session cache limiter &#8211; headers<br \/>\r\n  already sent by (output started at \/public_html\/includes\/application_top.php:2)<br \/>\r\n  in \/public_html\/includes\/functions\/sessions.php line 102<\/strong><\/em><strong><\/strong><\/p>\r\n<p>  please do the following:<\/p>\r\n<p>  1. Look for the first file mentioned in the error on your FTP and open it for editing.<br \/>\r\n  In this particular case the file is called <strong>application_top.php<\/strong> located in the <strong>\/public_html\/includes\/<\/strong>  folder (OsCommerce template). In your case the name of the file and its location are different.<\/p>\r\n<p>  2. Delete all spaces and blank lines under the last closing PHP tag <strong>?&gt;<\/strong> if there are any. Save the<br \/>\r\n  changes.<\/p>\r\n<p>  3. Look for empty lines and spaces before the first opening PHP tag <strong>&lt;?php<\/strong>   If there are any, remove them. Save the changes.<\/p>\r\n<p>  4. Make sure there are no empty lines\/spaces between the closing and the next opening PHP<br \/>\r\n  tags. If there are any, remove them. Save the changes.<\/p>\r\n<p>  5. Refresh your browser window with your site opened in it to check if the problem is solved.<\/p>\r\n<p>  <strong>Important:<\/strong><\/p>\r\n<p>Even if you checked EVERYHING mentioned above, but the error still persists:  <\/p>\r\n<p>1) try another editor. Check the error file in a different problem.<\/p>\r\n<p>  For instance, Notepad in Unicode may add the byte order mark (BOM) character before &lt;?,<br \/>\r\n  which you can delete only a HEX-editor or in IDE. In DreamWeaver and Notepad it is not visible,<br \/>\r\n  so make sure to save your file in UTF without BOM.<\/p>\r\n<p>  2) simply turn off this error reporting by opening the error file or your index.php file and<br \/>\r\n  adding<\/p>\r\n<p>  <strong>error_reporting(E_ALL ^ E_ WARNING);<\/strong><\/p>\r\n<p>  right after <strong>&lt;?php<\/strong><\/p>\r\n<p>  More details here http:\/\/php.net\/manual\/en\/function.error-reporting.php.<br \/>\r\n  You can also check the demo movie below.<\/p>\r\n<p><a href=\"\/help\/files\/headers_already_sent_problem_solving.htm\" target=\"blank\">Troubleshooter. Cannot add header information &#8211; headers already sent<\/a> <\/p>\r\n<p><!--more--> <\/p>\r\n<p><!--more--> <\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to resolve the issue causing the &quot;Cannot add header information &#8211; headers already sent&quot; error message.<\/p>\n","protected":false},"author":30,"featured_media":14097,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[723,724,731,732,733,728,734],"tags":[2564,1477,1134,911,690],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/14095"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=14095"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/14095\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/14097"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=14095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=14095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=14095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}