How can I defeat this header was already sent error in php?

Matthew Gatioan

New member
I know this is a problem with session headers. I have this error in my hosting server Myhosting.com

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /usr/local/pem/vhosts/107547/webspace/httpdocs/index.html:1) in /usr/local/pem/vhosts/107547/webspace/httpdocs/scripts/PHP-Login/auth.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/local/pem/vhosts/107547/webspace/httpdocs/index.html:1) in /usr/local/pem/vhosts/107547/webspace/httpdocs/scripts/PHP-Login/auth.php on line 3 Warning: Cannot modify header information - headers already sent by (output started at /usr/local/pem/vhosts/107547/webspace/httpdocs/index.html:1) in /usr/local/pem/vhosts/107547/webspace/httpdocs/scripts/PHP-Login/auth.php on line 7

This problem is not present in my localhost server using XAMPP. It is perfectly running fine. Until everytime I test my entire website in my hosting server. I am pissed off now. Is this a problem the way Myhosting server hosts its customer?

My website should be running fine. I tested it locally using XAMPP and WAMP. I need those sessions to authenticate people going in because it is a private website.
In my Localhost server in XAMPP I can login and logout. redirecting when user and password is wrong to an access denied page. I dont know what went wrong. Can you please elaborate what could be the problem. I know about the issue of having output before redirecting and other stuff pertaining to causing this error. But still this is not the way it should be. Is there something I can configure in my host server? or ask them about this?
 
Back
Top