Parse error: syntax error, unexpected $end in … on line …
Don’t you love it when the line number indicated for an error message is the last line in the file which obviously has no error? I spent twenty minutes on this one last night.
Check for unmatched braces, brackets, parentheses or PHP tags. Nope.
Try echoing line numbers to see where execution stops. In this case no output was generated even with an echo on line #1.
Create a new file and pasted the code as Unix ASCII. Still no change.
Check PHP settings. short_open_tag is disabled by default.
105:short_open_tag => On => On
Create .htaccess file:
Page loads with no errors.
Do a search for short open PHP tags in the source and replace with default tags.
Find
Replace
Turn short_open_tag back off in .htacess:
Page still loads with no errors.
Popularity: 39% [?]






{ 2 comments… read them below or add one }
i have error on my php code ,the error is Parse error: syntax error, unexpected $end in E:\AppServ\www\constant.php on line 17
Three plus five
three plus five
demonstrate use of number variables
$x $y = $sum
$x – $y = $dif
$x * $y = $prod
$x / $y = $quotient
HERE;
?>
this one $x $y = $sum
$x – $y = $dif
$x * $y = $prod
$x / $y =$quotient
HERE;
?>