psychopath Posted February 23, 2013 Share Posted February 23, 2013 When creating a account or trying to login to the wehhsop as a customer I get this error: "Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /home/w/wahlande/www/webbutik/katalog/includes/functions/sessions.php on line 179 Warning: Cannot modify header information - headers already sent by (output started at /home/w/wahlande/www/webbutik/katalog/includes/languages/swedish/login.php:1) in /home/w/wahlande/www/webbutik/katalog/includes/functions/general.php on line 49" I can not find the reason for this. It´s a clean installation. I´ve tried with PHP 5.2.17, PHP 5.3.19 and PHP 5.4.9 but still the same problem. I also got a setup with Oscommerce 2.2 and that one works fine. Any suggestions or ideas? You can try to create a account at http://www.wahlanders.se/webbutik/katalog/login.php to see the error. Link to comment Share on other sites More sharing options...
Bob Terveuren Posted February 24, 2013 Share Posted February 24, 2013 Hi Check the file at katalog/includes/languages/swedish/login.php and look for any whitespace at the head of the file before the opening <?php (maybe a space maybe a blank line) - if you find any remove it and see if that works Bob Link to comment Share on other sites More sharing options...
psychopath Posted February 24, 2013 Author Share Posted February 24, 2013 Hi Check the file at katalog/includes/languages/swedish/login.php and look for any whitespace at the head of the file before the opening <?php (maybe a space maybe a blank line) - if you find any remove it and see if that works Bob THANKS! There was not whitespace at the beginning of the files but there was a blank line at the end of the files, removed it and now it works! Link to comment Share on other sites More sharing options...
MrPhil Posted February 24, 2013 Share Posted February 24, 2013 Any text (even a blank) outside of <?php ... ?> PHP blocks will be immediately sent to the browser. If it's the first text of the page, it will force the HTTP headers to be flushed to the browser, no matter what state they're in. Once the headers have been sent to the page (too early), any calls to PHP's header() to set different header information will fail with the two errors you saw. Link to comment Share on other sites More sharing options...
psychopath Posted February 25, 2013 Author Share Posted February 25, 2013 Strange... If I save the file as ANSI it works but if I save the same file as UTF-8 it does not work, how come? Link to comment Share on other sites More sharing options...
MrPhil Posted February 26, 2013 Share Posted February 26, 2013 Saving it as UTF-8, your editor probably is sticking a Byte Order Mark at the very beginning of the file. That will cause headers to be flushed to the browser too early. See if your editor has an option to "save without BOM". Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.