错误:“无法发送会话缓存限制器”与编码相关
我开始遇到编码问题,似乎 Notepad++ 以某种方式更改了编码或其他内容。无论如何,所有文件都以 UTF-8 编码,但我检查了一下,有些文件更改为没有 BOM 的 UTF-8。将其更改为 UTF-8 解决了特殊字符问题。
"Tageá"
更改为 "Tageá"
但我开始收到错误:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/02/6945202/html/usuario/index.php:1) in /home/content/02/6945202/html/usuario/index.php on line 1
这是第 1 行:
<? session_start(); ?>
我不明白为什么会遇到此问题,因为使用没有 BOM 的 ANSI 或 UTF-8 页面显示没有错误。
可能是什么问题?谢谢
I'm started having problems with the encoding, it seems that somehow Notepad++ changed the encoding or something. Anyway all files where encoded in UTF-8, but I checked and some changed to UTF-8 without BOM. Changing one to UTF-8 fixed the special characters issue.
"Tageá"
changed to "Tageá"
but I started getting an error:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/02/6945202/html/usuario/index.php:1) in /home/content/02/6945202/html/usuario/index.php on line 1
This is line 1:
<? session_start(); ?>
I don't understand why I'm having this issue, since using ANSI or UTF-8 without BOM the page shows with no errors.
What can be the problem? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://blog.onitindustries。 com/php/errors/php-session_start-on-first-line-still-getting-error/
好的,尝试使用这个函数来转换字符串,将文件保存为没有 bom 的 utf-8 。
http://blog.onitindustries.com/php/errors/php-session_start-on-first-line-still-getting-error/
ok try using this function to convert strings, save file as utf-8 without bom for this.
这通常是由于在进行上述调用之前有一些输出造成的。发生这种情况是因为输出必须位于标头之后,因此如果有输出,则发送标头。空格会导致这种情况发生,甚至可能是由 PHP 标签前后的空格或换行符引起的。
要解决此问题,您可以消除此调用之前的所有输出,尽管这通常不可行。
更好的解决方案是在 php.ini 中启用 output_buffering。
This is generally caused by having some output before you make the above call. This happens because output must come after headers, so if there is output the headers are sent. Whitespace will cause this to happen, which can even be caused by spaces or newlines before or after the PHP tags.
To fix this problem you can eliminate all output before this call, though this is often not feasible.
A better solution is to enable output_buffering in your php.ini.
转换字符编码而不将文件编码更改为 UTF-8 without BOM,因为它在 session_start() 之前生成空间
convert character encoding without changing the file encoding to UTF-8 without BOM because it is generating space before session_start()