The problem was evidently that the file was not using a
.php file extension. While Unix-like systems typically don't care what the file extension is (i.e. programs should be able to tell filetype without the extension in most cases), the web server does rely on the file extension to tell it whether or not it needs to do preprocessing.
The solution, of course, is to use a
.php extension for the file rather than some other extension.
As a suggestion for troubleshooting in the future, the linked image from the text editor shows based on its coloring that it, in fact, believes something stops at the
> character in the
if statement. While it is easy to identify this as the result of a wrong file extension in retrospect, it could have been a clue that the issue did not lie in an error in the web server.
Credit for the solution goes almost exclusively to md5madman on for the answer to this question on Stack Overflow.