$ _SESSION问题

时间:2009-05-16 21:21:12

标签: php

我最近更改了我的编辑器以保存int UTF-8。这开始后突然出现,不知道它意味着什么。

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sudancar/public_html/index.php:1) in /home/sudancar/public_html/index.php on line 1

2 个答案:

答案 0 :(得分:12)

您的编辑很可能会写出一个BOM(字节顺序标记)来表明该文件是UTF-8。

因为该标记出现在任何<?php标记之前,PHP会自动将其发送到浏览器,包括必要的标题。

除非您的PHP可以使用实验(--enable-zend-multibyte)选项进行编译,否则无法提供帮助。你只需告诉编辑不要写那个标记。

供参考:http://bugs.php.net/bug.php?id=22108

答案 1 :(得分:1)

在将任何输出发送到浏览器之前,您需要调用session_start()