I got some strange problem where i have 2 copies of same website in 2 different folders. In one of those 2 copies has whitespace before doctype declaration so i have problem
You may not believe but I have a MAGIC way to solve this problem:
Upload your documents (which are included before ) on your host using File Manager of CPanel, then choose the document and Click "Edit" to see the source code of the document. Then press Ctrl+Home then press Delete!
You see that nothing will be deleted but that hidden white space!! Save your document and you will notice that everything is OK now.
I do this for all of my projects