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
I'm almost positively certain that you have some trailing whitespace at the end of a PHP include. Check there first.
Example:
Then
... pretend this text isn't here
I added the note at the end to get stackoverflow's markdown editor to show the additional lines after the closing ?>
tag. PHP automatically truncates one newline character after the tag in includes, but if you have more than one they will be interpreted as blank space before your doctype declaration.
Easiest fix? Remove the closing tag ?>
from all of your includes. This is a valid technique, and could be the fastest way for you to get up and running.