Failed to start the session because headers have already been sent
Permalink
I've just tried moving a site to my customer's webhost. However, I get the below error when I try to call the site.
Has anyone else experienced this and knows how to solve it?
(When I try to run a new install on this webhost, the environment checker tells me to disable PHP's ASP Style Tags. Will look into this now...)
Failed to start the session because headers have already been sent by "../application/config/database.php" at line 1.
Has anyone else experienced this and knows how to solve it?
(When I try to run a new install on this webhost, the environment checker tells me to disable PHP's ASP Style Tags. Will look into this now...)
There has been a php warning or error output very early on in the request, before the session was handled. If you do a right click and view source in your browser (view source, not the developer console) you will probably see the error report right at the top of the raw source.
Just ran into this message again, this time after changing database.php.
- Client has cancelled a domain name
- Database.php pointed to said domain name
- changed database.php ('server') to point to the correct name
- now get the following message
Anyone else experienced this? How do you deal with it?
- Client has cancelled a domain name
- Database.php pointed to said domain name
- changed database.php ('server') to point to the correct name
- now get the following message
An unexpected error occurred. Failed to start the session because headers have already been sent by "/application/config/database.php" at line 1.
Anyone else experienced this? How do you deal with it?
Problem was caused by a faulty encoding of the database.php file. My FileZilla was configured to use LibreOffice Writer as its default editor. This somehow messed up the encoding. Ouch.
Anyway, I checked the encoding with Sublime Text (run view.encoding() in the console). It was set to 'UTF-8 with BOM'.
After saving the file with plain 'UTF-8' encoding and reuploading it, the site became accessible again.
Thanks to @daenu for pointing this out!
Anyway, I checked the encoding with Sublime Text (run view.encoding() in the console). It was set to 'UTF-8 with BOM'.
After saving the file with plain 'UTF-8' encoding and reuploading it, the site became accessible again.
Thanks to @daenu for pointing this out!