mentalist Posted October 25, 2010 Share Posted October 25, 2010 I understand the warning, but I don't get the issue on my local server, only on my live server. From what I can see in the outputted source is a space and also i'm assuming a newline, before the warning... I've traced every route in my code, no output what-so-ever. I can't believe the hosts would insert such characters. I've tried separate files within the root directory, an html and a php, neither output these characters. Eventually I commented out the inclusion of modules one by one and found that the error should be in a specific one of these... Now going through I can't find any 'echo' or 'print' statements. Everything is within functions, and this error happens before anything is called, just included. There are no erroneous spaces before or after php code tags. What else would / could produce output? (and why no issue on local server?) EDIT: There is no use of 'output buffering' either... Quote Link to comment https://forums.phpfreaks.com/topic/216785-warning-cannot-modify-header-information/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 25, 2010 Share Posted October 25, 2010 Cannot directly help you without knowing where the error message states the OUTPUT is occurring AT. You likely have output_buffering turned on in your php.ini, which is hiding the problem on your local development system and the output is probably the BOM (Byte Order Mark) characters that your editor is placing at the start of one or more files. Quote Link to comment https://forums.phpfreaks.com/topic/216785-warning-cannot-modify-header-information/#findComment-1126213 Share on other sites More sharing options...
mentalist Posted October 25, 2010 Author Share Posted October 25, 2010 hmmm, from the file stated in the 'output' comment, I looked for ref's to 'ob_*' and found a download script. After a bit of trial and error I can pin it down to the 'flush' statement. (? none of this is getting executed though, just included... ?) I remember I found this download script somewhere in the manual (just because my versions failed at some point, so)... ... header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: '.filesize($file)); ob_clean(); //flush(); readfile($file); exit; ... I have now put in 'ob_flush' instead, not that from reading the manual it tells me to do it (it actually states it wasn't being called and is separate to 'flush' entirely). So should I or shouldn't I? Quick tests are indicating that the download script is still working... I've not got around to checking the ini references yet, do you still think that is an issue. I'm using GEdit on Fedora, will that add BOM's to my files, i've never had this issue before... Any which way, many many thanks... Quote Link to comment https://forums.phpfreaks.com/topic/216785-warning-cannot-modify-header-information/#findComment-1126221 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.