php网站搬家引起的”syntax error unexpected $end”解决办法


Parse error: syntax error, unexpected $end in ……


后来在iis7的php manager插件中编辑php配置就解决了,原因可能是php.ini的默认配置不支持一些wordpress的插件吧!可以在图形界面下修改,也可以找到该文件手动修改。


报错的原因是:集成安装环境包默认的情况下不支持 PHP 短标签
解决办法:打开 php.ini ,找到 short_open_tag = Off 这一行,将 Off 修改为 On,保存退出,重启 Apache 就可以了。


In PHP 5, the following error may appears as an error entry in Apache error log or simply displays on PHP web page, even if calling to php scripts with php_info() works perfectly and successfully returns information on PHP configurations:
Parse Error: syntax error, unexpected $end in ….. scripts.php on line …
The error may caused by a missing curly bracket in PHP script coding. Beside, it may also caused by error in PHP coding in class definition, as in PHP, a class definition cannot be broke up and distributed into multiple files, or into multiple PHP blocks, unless the break is within a method declaration.
But more commonly, the error is often caused by the use of Short Open tags in PHP, To use short open tags, it must be enabled in PHP.INI. Search for short_open_tag in PHP.INI, and change the value to On. The line should look line:
short_open_tag = On


电子邮件地址不会被公开。 必填项已用*标注

Time limit is exhausted. Please reload CAPTCHA.