当前位置:编程学习 > php >>

php Cannot send session cache limiter

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???

看个实例

<?php
session_start();

echo 'Welcome to page #1';

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

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>

并且<? 前面不能有任何字符
但还有几种我没试,他们是
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.zzzyk.com
*/

补充:Php教程,Php常用代码
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,