php Cannot send session cache limiter

來源:互聯網
上載者:User

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
*/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.