The browser will return a 500 error if no text is sent to the browser - even if there are no syntax errors.
For example:
if ($asdf == $qwerty)
{
print "Content-type: text/html", "\n\n";
print "<body>fasdfasdf</body>";
}
############
# end code #
############
if...