In the actual HTML code generated, which you kindly uploaded for inspection, line 23 begins with U+FEFF ZERO WIDTH NO-BREAK SPACE. It is an invisible control character, which is completely valid as such in HTML, but it is taken as a data character. No data characters except whitespace (and U+FEFF is by definition not whitespace in HTML) are allowed between elements in the head
part. This means that any data character there (whether U+FEFF or FOOBAR) implicitly closes the head
element and opens a body
element (where data characters are allowed). This explains the error messages.
U+FEFF is the same character as the Byte Order Mark (BOM). Apparently, a .php file has been saved in UTF-8 format with BOM at the very start. Although BOM is perfectly legal (and often useful) at the start of a UTF-8 datastream, it has a different meaning (as a data character) anywhere else. PHP processors fail to remove the BOM when they insert the content of a .php file.
So the problem should be fixed by opening the db_connect.php file in an editor and saving it in UTF-8 format without BOM.