473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to fix Cannot send session cache limiter - headers already sent error

anjali321
Can anyone help me out in fixing the problem?

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/aman/public_html/contactus.php:1) in /home/aman/public_html/contactus.php on line 2

I would be much thankful...
Jun 24 '10 #1

✓ answered by saviola

There are few thing which can produce this warning :
- If you are using cookie-based sessions, you must call session_start()before anything is outputted to the browser.
- Remember that header() must be called before any actual output is sent,
either by normal HTML tags, blank lines in a file, or from PHP. It is a very
common error to read code with include(), or require(), functions, or
another file access function, and have spaces or empty lines that are output
before header() is called. The same problem exists when using a single
PHP/HTML file.
- Or maybe the problem is about the corrupted characters before <?php . Those appears when you changed encoding ANSII to UTF-8. Edit your configuration.php with a HEX editor or re-encode it with Notepad++ and select "Encode in UTF-8 without BOM". To see what exactly i mean check this LINK

3 11511
There are few thing which can produce this warning :
- If you are using cookie-based sessions, you must call session_start()before anything is outputted to the browser.
- Remember that header() must be called before any actual output is sent,
either by normal HTML tags, blank lines in a file, or from PHP. It is a very
common error to read code with include(), or require(), functions, or
another file access function, and have spaces or empty lines that are output
before header() is called. The same problem exists when using a single
PHP/HTML file.
- Or maybe the problem is about the corrupted characters before <?php . Those appears when you changed encoding ANSII to UTF-8. Edit your configuration.php with a HEX editor or re-encode it with Notepad++ and select "Encode in UTF-8 without BOM". To see what exactly i mean check this LINK
Jun 25 '10 #2
Oh ya, I solved the problem.
It was the corrupted characters before <?php which didn't show up even with notepad++. finally, i removed it with Vim.
Thank u sooo much. I am much happy now!! :)
Jun 26 '10 #3
Markus
6,050 Expert 4TB
Shameless plug: the topic is discussed in length in this article: http://bytes.com/topic/php/insights/...s-already-sent
Jun 27 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: lawrence k | last post by:
I'm getting this warning: PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in...
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
14
by: bb nicole | last post by:
I using session when creaate a forum. But it display error like: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at...
4
by: three-eight-hotel | last post by:
I'm somewhat of a newbie to PHP coding, but have developed a site using the technology, and have been pleasantly surprised by the capabilities offered. I am more comfortable in the ASP world,...
3
by: mrosado | last post by:
Hi everybody, I have this problem.- The browser launch this two errors: Warning: session_start() : Cannot send session cache limiter - headers already sent (output started at...
1
by: gipsy | last post by:
Hello, I know that you guys are familiar with this, but I tried almost every solution I googled, but no chance getting it wroked, here is the error. and here is the sessiondata.php lines,...
2
by: mercedes1954 | last post by:
Hi, I am using header("Location: in two places in my script, but they are in mutually exclusive blocks i.e if one runs, the other can't. However, an error is thrown pointing to the...
2
irfanmodan
by: irfanmodan | last post by:
when i run client side login page... in login page i include menutop.php,then in menutop me call commonfile.php,code of commonfile.php as below..... <? session_start(); ?> <?...
1
by: ivan bravo | last post by:
Warning: session_start() : Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\wwwroot\pum\commons\Session.Commons.mod ule.php:7) in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.