---
title: "php Parse error: syntax error, unexpected end of file"
author: "hae"
date: "2016-03-03T19:28:36Z"
tags: []
categories: ["编程语言"]
slug: "php-parse-error-syntax-error-unexpected-end-of-file"
draft: false
lastmod: "2016-03-03T19:28:36Z"
id: 2280350
url: "https://hae.iteye.com/blog/2280350"
---

使用xampp的wordpress时，按照新的主题时，发生如下错误：

 

Parse error: syntax error, unexpected end of file。。

 

然后我就根据提示，找到那个文件，然后错误中总是提示最后一行出错，我找到最后一行发现php最后没有正常结束，即

&lt;?php

?&gt;

or

&lt;?

?&gt;

添加之后仍然报同样的错误，找了好久才找到问题所在即开启php短标签。

具体做法是，在php.ini文件中查找  short\_open\_tag 

修改成short\_open\_tag=On,如果已经是On了就说明短标签已经开启了，无需再设置了

![](http://dl2.iteye.com/upload/attachment/0115/5162/1ec9cfab-bf71-3160-bb07-7cda0dac0898.jpg)