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.111cn.net
*/