After several frustrating days of trying to get my php-nuke 6.5 to work correctly I thought I'd share something I accidentally ran across.
If you use the filemanager within cpanel to edit your php files you should know that filemanager automatically adds two blank lines to the end of the file when you save. Now normally this may not seem to be a big deal but when you start doing includes and requires than it becomes a big headache. If you include a php file with a blank line before or after the php block this blank line gets rendered as output. This means that you can no longer manipulate any of the headers since output has already been generated. I kept getting the dreaded Cannot Modify Headers error because of a stray blank line. I ended up having to re-edit all the php files that I have edited in filemanager to remove the blank lines and ftp them back which magically cleared up all my problems.
This may not be news to some of you php veterans but hopefully this will save someone the same headache.
Supposedly you can avoid this behaviour if you turn on output buffering. Now I'm off to figure out why phpnuke's output buffering code doesn't work.
Andrew Chai


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks