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 problems to work with facebook as document is formated incorrectly.
Before html there is some php calculations, but there is no echo statements or something.
What could be cause for 2 identique websites under same server in different folders, one having this issue?
I’m almost positively certain that you have some trailing whitespace at the end of a PHP include. Check there first.
Example:
Then
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.