Friday, October 12, 2007

Parse error: syntax error, unexpected ':'

If short open tags are enabled and if the HTML content in a PHP file has a <\?, PHP will display the error, Parse error: syntax error, unexpected ':'

Tags such as <\? could be used to open XML tags or other non PHP based tags.

The solution is to disable the short_open_tag directive in the \/etc\/php.ini file. This would force PHP to parse PHP code with tags that begin with <\?php

No comments: