/    Sign up×
Community /Pin to ProfileBookmark

Please help! "Session Start Cannot Modify Header Information"

I had an error in which I had someone do a fix of my index.php file for my website [url]www.alliancedirect.net[/url] and everything was solved and perfect! I always used Adobe Contribute CS4 to add the page title and header information (keywords & description) but this was the first time since this guy had helped me fix my problem in which I had modified the wrong file and when I used Contribute to edit the page title & header, my website instantly gave the following error message on the top of the flash and even my drupal (html portion) of the site:

[i][b]“Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 899

Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 899

Warning: Cannot modify header information – headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 531

Warning: Cannot modify header information – headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 532

Warning: Cannot modify header information – headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 533

Warning: Cannot modify header information – headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 534″[/b][/i]

I went back to my Adobe Contribute CS4 and deleted the keywords and description I had entered and attempted to get rid of the title but it wouldn’t and won’t let me since I had already inputted it via Contribute. Also, I assume what it is, is that I already had the title in on my index.php.

[b]I went to the following lines as stated in bootstap.inc and I got the following:

Line 899: “session_start();”

Lines 531-534 (I posted lines 530-535 because it showed some drupal stuff which may or may not be applicable):
530: function drupal_page_header() {
531: header(“Expires: Sun, 19 Nov 1978 05:00:00 GMT”);
532: header(“Last-Modified: ” . gmdate(“D, d M Y H:i:s”) . ” GMT”);
533: header(“Cache-Control: store, no-cache, must-revalidate”);
534: header(“Cache-Control: post-check=0, pre-check=0”, FALSE);
535: }

This is what I see at the beginning of my index.php file:

<meta name=”keywords” content=””>

<meta name=”description” content=””>

<title>Alliance Direct Financial Source offers mortgage loan modification finance refinance short sale foreclosure bailout</title><?php

// $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $[/b]

I don’t want to dive into this alone as I don’t want to mess anything up. The pages are tied to both my flash page [url]http://www.alliancedirect.net[/url] and any part of my non-flash page such as [url]http://www.alliancedirect.net/calculators[/url] .

Can anyone please help me with this today since today is New Years and a non-workday? Thanks again for all your help and a Happy New Years to all!

to post a comment
PHP

12 Comments(s)

Copy linkTweet thisAlerts:
@ratcatemeJan 01.2009 — to send out headers or start a session(it sends out headers) you must have not had any output so no echo's print's or html outside <?php ?> tags

looking at the errors and your code posted index.php has some html outside <?php ?> tags at line 3 or has a echo or print at line 3.

you need to modify it so includes/bootstrap.inc is included before any output in index.php

Scott.
Copy linkTweet thisAlerts:
@xxsassxx31authorJan 01.2009 — thx Scott. Sorry i'm a novice. I will try to see what I can do...
Copy linkTweet thisAlerts:
@xxsassxx31authorJan 01.2009 — scott, is it the index.php or the bootstrap.inc i edit? Sorry i am a novice but if i know exactly where to go i know enough to do this!
Copy linkTweet thisAlerts:
@ratcatemeJan 01.2009 — you need to edit index.php

and if you look through it there should be line like

include "includes/bootstrap.inc";

or

require "includes/bootstrap.inc";

and move that to the top of the file

and make sure it is inside <?php ?> tags

Scott.
Copy linkTweet thisAlerts:
@xxsassxx31authorJan 01.2009 — This is what I found, I just want to make sure it doesn't mess up my website and Scott, I thank u once again for all your help!

[B][I]"require_once './includes/bootstrap.inc';



drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);"[/I]
[/B]


Should both of these be moved up?
Copy linkTweet thisAlerts:
@xxsassxx31authorJan 01.2009 — Scott, here is the coding for the 1st half of my index.php which I think is applicable in solving this issue. I just messed up once before and it was a mess so I want to make sure I get this right 100&#37;. Thanks buddy:

<meta name="keywords" content="">

<meta name="description" content="">

<title>Alliance Direct Financial Source offers mortgage loan modification finance refinance short sale foreclosure bailout</title><?php

// $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $



/**

  • * @file


  • * The PHP page that serves all page requests on a Drupal installation.

    *


  • * The routines here dispatch control to the appropriate handler, which then


  • * prints the appropriate page.

    */




  • require_once './includes/bootstrap.inc';

    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);[/QUOTE]
    Copy linkTweet thisAlerts:
    @ratcatemeJan 01.2009 — [code=php]<?php require_once './includes/bootstrap.inc'; ?><meta name="keywords" content="">

    <meta name="description" content="">

    <title>Alliance Direct Financial Source offers mortgage loan modification finance refinance short sale foreclosure bailout</title><?php

    // $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $



    /**

    * @file

    * The PHP page that serves all page requests on a Drupal installation.

    *

    * The routines here dispatch control to the appropriate handler, which then

    * prints the appropriate page.

    */


    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);[/code]

    who added the html at the top it looks very out of place

    Scott.
    Copy linkTweet thisAlerts:
    @xxsassxx31authorJan 01.2009 — thx buddy! i will give the code u helped me with a try. this guy had helped me i guess he just made a mistake. thx again and i will post the results
    Copy linkTweet thisAlerts:
    @xxsassxx31authorJan 01.2009 — I put the code u posted above and added it to my file and it still gives:


    "Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:5) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 899

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/s/h/a/shawn31/html/index.php:5) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 899

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:5) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 531

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:5) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 532

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:5) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 533

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:5) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 534"

    what are we doing wrong?
    Copy linkTweet thisAlerts:
    @ratcatemeJan 02.2009 — try
    [code=php]<?php require_once './includes/bootstrap.inc';
    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);?><meta name="keywords" content="">

    <meta name="description" content="">

    <title>Alliance Direct Financial Source offers mortgage loan modification finance refinance short sale foreclosure bailout</title><?php

    // $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $



    /**

    * @file

    * The PHP page that serves all page requests on a Drupal installation.

    *

    * The routines here dispatch control to the appropriate handler, which then

    * prints the appropriate page.

    */[/code]


    Scott.
    Copy linkTweet thisAlerts:
    @xxsassxx31authorJan 02.2009 — Scott, thanks so much! You have been a ton of help! Thank god my issue is solved and thanks to you ?. I appreciate it so much buddy. Last question and then i'm off; it won't mess up again if I edit the title and keywords & description in adobe contribute cs4, correct? thx again!
    Copy linkTweet thisAlerts:
    @ratcatemeJan 02.2009 — no you do that in some kind of setting in your php code the might be a config file with that stuff in it i dont know

    if you view the source of the page there is the title form that code you have posted then the php also outputs a title that is put inside the <html> and <head> tags

    Scott.
    ×

    Success!

    Help @xxsassxx31 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.27,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...