I got an error:
Parse error: syntax error, unexpected end of file in the line
With this code:
I had the same error, but I had it fixed by modifying the php.ini and / or editing the PHP file!
There are two different methods to get around the parse error syntax.
Avoid in your PHP file this:
} ?>
Make sure you put it like this
Your code contains
?>
NOTE: The missing
php
after!
There is also a simple way to solve your problem.
Search for the short_open_tag
property value (Use in your text editor with Ctrl + F
!), and apply the following change:
; short_open_tag = Off
to
short_open_tag = On
According to the description of core php.ini directives, short_open_tag
allows you to use the short open tag () although this might cause issues when used with xml (
will not work when this is enabled)!
NOTE: Reload your Server (like for example: Apache) and reload your PHP webpage in your browser.