Top Nav

PHP Parse error: syntax error, unexpected $end

There are two common causes to this error:

1. You have an actual syntax error in you code that needs to be fixed.

2. Your code is expecting the PHP “short_open_tags” setting to be turned on and it is not.

This second case is common when you’re moving a site between servers – the old server has short_open_tags turned on and the code works but the new site has it turned off and the code breaks.

The solution to the second case is to either (a) modify the code to remove the dependency on short_open_tags or (b) turn on short_open_tags in php.ini or your .htaccess file.