Headers already sent

Hi,
I downloaded the latest OC 1.5.3. Using WAMP I set up and run my website on my local machine and now I have uploaded the files to the actual host, configured DB and updated config.php files with the correct info. However when I try to access my website using the temporary URL, the website works but I see the following error message at the top:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/beautyst/public_html/config.php:47) in /home/beautyst/public_html/system/library/session.php on line 11Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/beautyst/public_html/config.php:47) in /home/beautyst/public_html/system/library/session.php on line 11Warning: Cannot modify header information - headers already sent by (output started at /home/beautyst/public_html/config.php:47) in /home/beautyst/public_html/index.php on line 175Warning: Cannot modify header information - headers already sent by (output started at /home/beautyst/public_html/config.php:47) in /home/beautyst/public_html/system/library/currency.php on line 45

Any idea why this is happening and how to solve it?

Thanks

I didn’t find the right solution from the internet.
References:
https://forum.opencart.com/viewtopic.php?t=49612

Hi @jenkinsharry280 and welcome to the forum.

Try searching for every session_start(); and use the following script or something similar:

if ( isset( $_SESSION ) ):
  // no need to load again
else:
  session_start();
endif;  

It’s happening because you must call session_start() before any output to the browser. So even having a blank line in your page source prior to opening PHP tags can cause it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.