Cache-limiter error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • STEPHEN GOODE

    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/someincludescri pt.php:2) in
    /www/html/app/includes/session.php on line 3

    The main script has

    <?
    include("/www/html/app/includes/someincludescri pt.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 someincludescri pt.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 someincludescri pt.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 (unintentionall y) and
    causing the error.
    3. The someincludescri pt.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




  • Daniel Tryba

    #2
    Re: Cache-limiter error

    STEPHEN GOODE <rexgoode@veriz on.net> wrote:[color=blue]
    > 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 (unintentionall y) and
    > causing the error.
    > 3. The someincludescri pt.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.[/color]

    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
    someincludescri pt.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!

    Comment

    • STEPHEN GOODE

      #3
      Re: Cache-limiter error


      "Daniel Tryba" <spam@tryba.inv alid> wrote in message
      news:41d516e0$0 $6221$e4fe514c@ news.xs4all.nl. ..[color=blue]
      > STEPHEN GOODE <rexgoode@veriz on.net> wrote:[color=green]
      >> 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 (unintentionall y)
      >> and
      >> causing the error.
      >> 3. The someincludescri pt.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.[/color]
      >
      > 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
      > someincludescri pt.php but has the sole purpose to give some fedback.
      >
      > It might help if tell what secrect code is on line 2.[/color]

      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.
      [color=blue]
      > BTW you have checked the differences between dev and producion machines?[/color]

      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.
      [color=blue]
      > You do develop with E_ALL![/color]

      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
      someincludescri pt.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


      Comment

      • Daniel Tryba

        #4
        Re: Cache-limiter error

        STEPHEN GOODE <rexgoode@veriz on.net> wrote:[color=blue][color=green]
        >> It might help if tell what secrect code is on line 2.[/color]
        >
        > That's part of my problem. Line 1 is "<?". Line 2 is blank.[/color]

        The the recent thread about shorttags.

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

        Comment

        • STEPHEN GOODE

          #5
          Re: Cache-limiter error

          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


          Comment

          • Daniel Tryba

            #6
            Re: Cache-limiter error

            STEPHEN GOODE <rexgoode@veriz on.net> wrote:[color=blue]
            > 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.[/color]

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

            Comment

            • STEPHEN GOODE

              #7
              Re: Cache-limiter error

              HOw would I do that?

              "Daniel Tryba" <spam@tryba.inv alid> wrote in message
              news:41d57cac$0 $6214$e4fe514c@ news.xs4all.nl. ..[color=blue]
              > STEPHEN GOODE <rexgoode@veriz on.net> wrote:[color=green]
              >> 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.[/color]
              >
              > Oneway to find out: request someincludescri pt.php directly and see what
              > you get servered.
              >[/color]


              Comment

              • R. Rajesh Jeba Anbiah

                #8
                Re: Cache-limiter error

                STEPHEN GOODE wrote:[color=blue]
                > "Daniel Tryba" <spam@tryba.inv alid> wrote in message
                > news:41d516e0$0 $6221$e4fe514c@ news.xs4all.nl. ..[/color]
                <snip>[color=blue]
                > Another problem I'm having is that he doesn't want to set[/color]
                display_errors off[color=blue]
                > and log_errors on. He says that it's inconvenient to check[/color]
                phperrors.log and[color=blue]
                > would rather see errors in the browser so he can know they're[/color]
                happening. I[color=blue]
                > tried to convince him that he didn't want his users seeing errors,[/color]
                but he[color=blue]
                > takes the position that if there are no errors (perfect code), it[/color]
                won't[color=blue]
                > matter. There will be no errors for his users to see.
                >
                > I think it is highly possible that something in the installation of
                > someincludescri pt.php is creating a warning that is thrown to the[/color]
                browser[color=blue]
                > (because he has display_errors on). That warning is the output the[/color]
                second[color=blue]
                > warning is complaining about. I've asked him again to set[/color]
                display_errors to[color=blue]
                > off and log_errors to on, and send me the error log.[/color]

                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/

                Comment

                • Daniel Tryba

                  #9
                  Re: Cache-limiter error

                  STEPHEN GOODE <rexgoode@veriz on.net> wrote:[color=blue]
                  > HOw would I do that?[/color]

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

                  Comment

                  Working...