Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 508853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:57:01+00:00 2026-05-13T06:57:01+00:00

I just started making this .php file and i cant seem to figure out

  • 0

I just started making this .php file and i cant seem to figure out why its throwing this warning

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\xampplite\htdocs\projectchest\controlpanel\index.php:1) in C:\Program Files\xampplite\htdocs\projectchest\controlpanel\index.php on line 2

Here is my php.

<?php
    session_start();
    require_once('../classes/users/BaseUser.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   ...
</html>

And here is access to my php.ini file

pastebin dot com / f60d22891 sorry i cant post two links cuz of some spam nonsense

i also found this thread suggested that my permission settings are messed up. i tried this…no luck
PHP session_start fails

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:57:01+00:00Added an answer on May 13, 2026 at 6:57 am

    Sessions in PHP are based on a cookie (to transmit the session_id).

    Cookies are sent as HTTP headers.

    HTTP headers can only be sent if no output has already been sent.

    The error message you’re getting indicates that the session cookie cannot be sent because some output has already been sent.

    Which means you must be sure not to send any ouput (not even one white-space !) before calling session_start().

    A couple of ideas :

    • make sure there is no blank line before the opening php tag
    • make sure your PHP script is not encoded in UTF-8 with a BOM (some editor put that by default at the beginning of the files)
      • i.e. re-save your file (as UTF-8, why not), without a BOM

    As a sidenote : you might get this error on some servers, and not on some others, because of the configuration of output_buffering : if it’s on (it’s Off in your php.ini file), PHP will keep some data in memory before sending them — which means headers can be sent even if a small amount of data seems to have already been sent (In reality, that small amount of data is kept in memory, and not immediatly really sent).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.