473,385 Members | 1,562 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,385 software developers and data experts.

Cache-limiter error

I am getting the following error. I've changed the paths and file names here
to protect my client's confidentiality.

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
/www/html/app/includes/someincludescript.php:2) in
/www/html/app/includes/session.php on line 3

The main script has

<?
include("/www/html/app/includes/someincludescript.php");
include("/www/html/app/includes/session.php");
....
?>

Of course, session.php has a session_start() in it.

My understanding of this error is that someincludescript.php has some kind
of output going out of it at line 2. This would cause the session_start()
function to hiccup and give the warning. Examining someincludescript.php, it
has nothing that should be outputting to the browser. The earliest output in
the main script comes after session.php is included.

To complicate my problem more, all of it works fine on my development
server. When I ship the scripts off to my client and he installs them on his
server, the warning happens. I have taken steps to ensure that the DOS/UNIX
difference in line endings is not a problem. Both the development and
production servers run RedHat Linux. However, the scripts are sent via ftp
(ASCII xfer mode) to my Windows machine, emailed to client's Windows
machine, ftp'd (ASCII xfer mode) to his machine. His doesn't work.

Part of my frustration is that I have no direct influence over the
production server. I can accept that, but it makes it very hard to debug
problems like this. He says that his PHP errors log doesn't show any errors.

I have three suspicions:

1. There is some system setting somewhere, perhaps in php.ini, that is
different between the two servers.
2. My client is not installing the scripts correctly (unintentionally) and
causing the error.
3. The someincludescript.php script is causing an error at line 2 that tries
to write a warning to the browser, which triggers the warning.

Setting me straight on any of the above is welcome.

Rex


Jul 17 '05 #1
8 1670
STEPHEN GOODE <re******@verizon.net> wrote:
I have three suspicions:

1. There is some system setting somewhere, perhaps in php.ini, that is
different between the two servers.
2. My client is not installing the scripts correctly (unintentionally) and
causing the error.
3. The someincludescript.php script is causing an error at line 2 that tries
to write a warning to the browser, which triggers the warning.

Setting me straight on any of the above is welcome.


Those are all posibilities, 1 and 3 could be traced with a custom error
handler, to trace 2 supply the customer with a *very* simple sample code
that in essence does the some whater is on line 2 opse
someincludescript.php but has the sole purpose to give some fedback.

It might help if tell what secrect code is on line 2.

BTW you have checked the differences between dev and producion machines?
You do develop with E_ALL!

Jul 17 '05 #2

"Daniel Tryba" <sp**@tryba.invalid> wrote in message
news:41**********************@news.xs4all.nl...
STEPHEN GOODE <re******@verizon.net> wrote:
I have three suspicions:

1. There is some system setting somewhere, perhaps in php.ini, that is
different between the two servers.
2. My client is not installing the scripts correctly (unintentionally)
and
causing the error.
3. The someincludescript.php script is causing an error at line 2 that
tries
to write a warning to the browser, which triggers the warning.

Setting me straight on any of the above is welcome.
Those are all posibilities, 1 and 3 could be traced with a custom error
handler, to trace 2 supply the customer with a *very* simple sample code
that in essence does the some whater is on line 2 opse
someincludescript.php but has the sole purpose to give some fedback.

It might help if tell what secrect code is on line 2.


That's part of my problem. Line 1 is "<?". Line 2 is blank. I suspect,
however, that on the production server, there is a blank line before what I
sent him as 1 and 2. The entirety of that include file is a class
definition. It does nothing until the object is instantiated later, long
after the session is started. If there is a blank line or two at the top of
the include file, before the <?, that would account for the output the
warning is complaining about.
BTW you have checked the differences between dev and producion machines?
Another part of my problem, is that I don't have access to the production
machine at all, other than as a user. I can't see the php source as it
exists on production, so I can't check these things out for myself. I have
to rely on the man who pays me to code to report back to me what he sees. I
don't think he is answering my questions accurately. Could be a classic
example of a managerial type not understanding the technospeak of a
developer, but every time I ask him what is in the file after he installs
it, the answers I get from him don't seem to jive with the problem he is
reporting.
You do develop with E_ALL!


Another problem I'm having is that he doesn't want to set display_errors off
and log_errors on. He says that it's inconvenient to check phperrors.log and
would rather see errors in the browser so he can know they're happening. I
tried to convince him that he didn't want his users seeing errors, but he
takes the position that if there are no errors (perfect code), it won't
matter. There will be no errors for his users to see.

I think it is highly possible that something in the installation of
someincludescript.php is creating a warning that is thrown to the browser
(because he has display_errors on). That warning is the output the second
warning is complaining about. I've asked him again to set display_errors to
off and log_errors to on, and send me the error log. I think that will clear
the whole mystery up.

Rex
Jul 17 '05 #3
STEPHEN GOODE <re******@verizon.net> wrote:
It might help if tell what secrect code is on line 2.


That's part of my problem. Line 1 is "<?". Line 2 is blank.


The the recent thread about shorttags.

Subtile hint: _DON'T USE THEM_ if you want to make sure your script will
work anywhere :)

Jul 17 '05 #4
Have never used them before. The developer who created this system used them
and I haven't bothered to change them. I will definitely do the <?php thing
on this script too, but he's been working with it as <? for a couple of
years now. I don't think is the cause of the current problem.

Rex
Jul 17 '05 #5
STEPHEN GOODE <re******@verizon.net> wrote:
Have never used them before. The developer who created this system
used them and I haven't bothered to change them. I will definitely do
the <?php thing on this script too, but he's been working with it as
<? for a couple of years now. I don't think is the cause of the
current problem.


Oneway to find out: request someincludescript.php directly and see what
you get servered.

Jul 17 '05 #6
HOw would I do that?

"Daniel Tryba" <sp**@tryba.invalid> wrote in message
news:41**********************@news.xs4all.nl...
STEPHEN GOODE <re******@verizon.net> wrote:
Have never used them before. The developer who created this system
used them and I haven't bothered to change them. I will definitely do
the <?php thing on this script too, but he's been working with it as
<? for a couple of years now. I don't think is the cause of the
current problem.


Oneway to find out: request someincludescript.php directly and see what
you get servered.

Jul 17 '05 #7
STEPHEN GOODE wrote:
"Daniel Tryba" <sp**@tryba.invalid> wrote in message
news:41**********************@news.xs4all.nl... <snip> Another problem I'm having is that he doesn't want to set display_errors off and log_errors on. He says that it's inconvenient to check phperrors.log and would rather see errors in the browser so he can know they're happening. I tried to convince him that he didn't want his users seeing errors, but he takes the position that if there are no errors (perfect code), it won't matter. There will be no errors for his users to see.

I think it is highly possible that something in the installation of
someincludescript.php is creating a warning that is thrown to the browser (because he has display_errors on). That warning is the output the second warning is complaining about. I've asked him again to set display_errors to off and log_errors to on, and send me the error log.


Are you aware of ini_set() <http://in2.php.net/ini_set>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #8
STEPHEN GOODE <re******@verizon.net> wrote:
HOw would I do that?


The same as you do with other php scripts, use a browser and inserty the
url to the php file.

Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bite My Bubbles | last post by:
I found the answer! It is a IIS 6 /ASP problem http://support.microsoft.com/default.aspx?scid=kb;en-us;332075
2
by: Harry Simpson | last post by:
If anyone can chime in on these questions, I'd sure appreciate it. 1. How does the cache block fit in with the UIP Block - Is the "state" managed there handled any differently with the CAB...
5
by: Darrel | last post by:
I thought this warranted a new thread. Yesterday I asked about access relatively static content...is it better to read from the DB, or just grab a text file. It was suggested that I use the DB...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
6
by: Charts | last post by:
I used HttpContext.Current.Cache To cache data from database. The code is like that. public static DataView GetCategories() { if ( HttpContext.Current.Cache == null ) {...
1
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). ...
13
by: Andrew Morton | last post by:
I am caching some data in VB.NET using System.Web.Caching, is it possible to lock the cache so that other sessions attempting to access the same cache wait when it is being updated? I have the...
26
by: Ed L. | last post by:
Here's some of my current notions on pgsql performance tuning strictly as it relates to pgsql tuning parameters in the context of a dedicated linux or hpux server. I'm particularly focusing on...
18
by: siddharthkhare | last post by:
Hi All, what is the diference between these two cache control header. no-cache and no-store. I have read the w3.org explanation. So lets say I am using only no-cache ....my understanding is...
0
by: Hypnotik | last post by:
My program is to simulate cache memory. I read in the info from 2 external files, 1) access 2) data in memory. When I read the information in I display the info...and it is all correct. However...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.