I was having this issue and ultimately tracked down the source to be the encoding of the PHP file. Apparently I had set my editor to use Unicode (2-byte unicode, not UTF-8) as the encoding. This causes PHP not to see the <? tags, but the browser seems to be able to read the Unicode file just fine, so viewing source reveals the actual PHP code. (Even though the file had a content-type=utf-8 meta tag!) Saving the PHP file in ANSI or UTF-8 encoding solved the problem.
Lots of debugging went into finding that simple solution, so I thought I'd add it here for anyone else who has this problem.
An interesting side-effect of the problem was that Firefox and Chrome didn't seem load the CSS file. Upon further examination, I found that browsers are supposed to assume the same encoding for CSS as for HTML, unless explicitly specified in the CSS file. Viewing the CSS in Chrome or Firefox would show Chinese characters! This helped lead me to the solution, actually.