0

our problem is " Cannot modify header information - headers already sent "?
Is anyone know about this problem that why this happen?

3
Contributors
2
Replies
20
Views
3 Years
Discussion Span
Last Post by almostbob
1

It generally happens when you output something before the header() function, for example:

<?php

    echo 'hey!';
    header('Location: /');

You should write your script to avoid these situations or, if you can modify your php.ini, then you can change the output_buffering directive to 4096 or to On, for more information check this:

1

It is an error in your code, as cereal shows
can be as simple as including an extra space where there shouldnt be one, before the opening <?php
that space is output to the browser and no headers can be sent
If you cannot locate it post the code and others will point out the fault,

its easy to see other's errors,
impossible to see your own. . . . . other peoples errors are more fun

if you do not have access to your php.ini file, many hosts do not permit it
file buffering can be enabled within the file, (in this case compression as well)

<?php ob_start("ob_gzhandler"); ?>
<!DOCTYPE html>
<html lang="en" xml:lang="en">
<head>
</head>
<body>
</body>
<script src='/js/bootstrap.min.js.php'></script>
</html>
<?php ob_flush(); ?>

Edited by almostbob

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.