Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP:无法发送会话cookie错误_Php_Session - Fatal编程技术网

PHP:无法发送会话cookie错误

PHP:无法发送会话cookie错误,php,session,Php,Session,我正在尝试设置一个会话,但是我收到了一个头错误,我告诉它在发送头之前启动会话。这里的任何帮助都是有用的 <?php ob_start(); session_start(); $_SESSION['active'] = 1; ob_end_flush(); ?> <html> <body> 2009c Christ Redeemer Catholic Church </body> </html> 2009c基督救赎主天主教堂 警告

我正在尝试设置一个会话,但是我收到了一个头错误,我告诉它在发送头之前启动会话。这里的任何帮助都是有用的

<?php
ob_start();
session_start();
$_SESSION['active'] = 1;
ob_end_flush();
?>
<html>
<body>
2009c Christ Redeemer Catholic Church 
</body>
</html>

2009c基督救赎主天主教堂
警告:session_start()[function.session start]:无法发送会话cookie-已由第3行的/home/content/k/u/r/kuriomister/html/temp/church/index.php中的/home/content/k/u/r/kuriomister/html/temp/church/index.php中的/home/content/content/k/u/r/kuriomister/index.php中启动的输出发送的标头


警告:session_start()[function.session start]:无法发送session cache limiter-头文件已发送(输出从/home/content/k/u/r/kuriomister/html/temp/church/index.php:1开始),在/home/content/k/u/r/kuriomister/html/temp/church/index.php第3行参见输出:
无法发送会话cookie-头文件已发送(输出从/home/content/k/u/r/kuriomister/html/temp/church/index.php:1开始)

您似乎有一些空白(空格、制表符、换行符等)在文件的开头。

如果使用UTF-8,请确保保存文件时不使用。

BOM=字节顺序标记。UTF-8=Unicode转换格式8位编码我突然遇到了完全相同的问题,整个服务器上的每个页面都出现了这个问题。我甚至没有做任何更改,这是几小时前开始的,我可以理解创建一个使用会话的新测试文件,即使在输出之前没有空格,它也会给出相同的错误,有什么办法可以修复吗?