Tuesday, August 17, 2010

How to Fix for: Parse error: syntax error, unexpected $end in

Problem

The site was built using Joomla! 1.5, so I enabled debugging mode and set the error reporting level to maximum to know what is the problem.

Then this error was displayed when opening any page:

Parse error: syntax error, unexpected $end in filename:lineno


Solution

it was the index.php / template.php / etc file of the template, and after some debugging I found that the problem is the using of short php tags, like this:
< ?
The server was not configured to allow short tags.
For maximum compatibility, it is preferred to use full tags, like this:
< ?php
Hope this help you all!

1 comment:

Peter said...

Hi,

zou can also set the proper option for this in the php.ini file. Using short tags, or something like this, and set to On from Off. And you won!t need to edit the template files later...

kunkun-laptop .... ;)