From the course: PHP for Web Designers
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
What does "headers already sent" mean? - PHP Tutorial
From the course: PHP for Web Designers
What does "headers already sent" mean?
One error message that's notorious for causing many hours of frustration, is headers already sent. Let's see what the problem is and how to fix it. I'm going to select a couple of flowers in this page here. And then click the Add to Basket button, and I've got an error message at the beginning. This page uses a PHP session and session variables. And the warning is, session_start): Cannot send session cache limiter - headers have already been sent. What headers already sent means is that some output has already been sent to the browser, so no changes can be made to the HTTP headers because they were already sent with the original output. As a result, the session can't be started. More important, without a session, you can't create or use session variables. I should point out that Zamp on Windows suppresses this problem through a configuration directive called output_buffering. I've added a .htaccess file to the chapter 07/07_05 folder to reset the buffer to zero because that's the way…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Dealing with PHP errors4m 15s
-
Why is my page blank or incomplete?3m 53s
-
(Locked)
Tracking down parse errors4m 32s
-
(Locked)
What to do with "failed to open stream"3m 22s
-
(Locked)
What does "headers already sent" mean?6m 18s
-
(Locked)
What does undefined index, variable, or constant mean?5m 52s
-
(Locked)
What on earth is T_ENCAPSED_AND_WHITESPACE?1m 59s
-
(Locked)
-