PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

php Cannot send session cache limiter

原创
2016-06-08 17:27:44 784浏览

Cannot send session cache limiter

/*


Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/canna/public_html/sites/default/settings.php教程:130) in /home/canna/public_html/includes/session.inc on line 10

warning: Cannot modify header information - headers already sent by (output started at /home/canna/public_html/sites/default/settings.php:130) in /home/canna/public_html/includes/common.inc on line 99.

any tips教程, ideas or solutions welcome :)
before I dig into the PHP (about which I know little or nothing) :-(

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:phpcodeadmin.php:1) in E:phpcodelogolistadminlogo.php on line 2

上网搜了一下,有人说是因为在session_start(); 语句之前有其他的html代码,但是我的session_start(); 已经在做前面了。
还有的说是因为没有设置session 保存路径,需要修改php.ini中的session.save_path = "C:/phpsession" [后边的路径自己设置,并且要保证存在。php.ini 文件一般应位于系统盘/Windows 目录下面]

但是我做如上设置之后还是会有这个提示。后来经过反复测试,终于解决问题。
解决办法:
修改php.ini中的session.auto_start = 0 为 session.auto_start = 1


Warning: Cannot send session cache limiter - headers already sent (output started at /home/alltom/public_html/flame/template.inc.php:1) in /home/alltom/public_html/flame/lib.inc.php on line 550

Whats wrong with that? I mean why am i getting it??

Line 547 to 550 in lib.inc.php:

session_set_save_handler('sess_open', '', 'sess_read', 'sess_write', 'sess_destroy', 'sess_gc');
session_name('s');
session_name('s');
session_start();


Im having problems with session_start() through out the site, any help???

看个实例

session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();

// Works if session cookie was accepted
echo '
page 2';

// Or maybe pass along the session id, if needed
echo '
page 2';
?>

并且 前面不能有任何字符
但还有几种我没试,他们是
1.php.ini中的output_buffering=off 改成output_buffering=4096
2.php.ini中的session.save_path是否设置好了
3.pgp.ini中的session.auto_start = 0 改成session.auto_start = 1

/*
fdsfds

本站原创文章转载注明来自www.111cn.net
*/

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。