Since you haven't provide your code, it is difficult to figure out what is the problem exactly & where it is. Here are some of common root problems that leads to these kind of errors.
Usually this error message gets prompts when some output is sent before to your HTTP headers are sent.
Here are some frequent causes to the type of errors
If there are white spaces at the beginning or end of files
<?php
// Note: There is a space before "<?php"
?>
Printing output before sending the headers
printing
echo
printf
readfile
passthru
print
vprintf
trigger_error
ob_flush
ob_end_flush
var_dump
print_r
flush
imagepng
imagejpegcodes
before sending headers.
<?php
echo "something";
header("Location:index.php");
?>
Sometimes cause can be a warning message outputted by php
display_errors php.ini
property will silently fixes the error and emits a warning instead of crashing on a programmer mistake. so before the header, that warning may be move first.
NOTE : What you should find out is, where the place that the application outputs an HTTP body before the HTTP header.
There is a nice article about this problem 'PHP development: why redirects don't work (headers already sent)', by Adobe
And also this answer in stackoverflow also points outs many error points How to fix “Headers already sent” error in PHP