PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
2014-06-23 09:04
896 查看
今天在写PHP程序的时候总是出现这样的错误:Parse error: syntax error, unexpected end of file in *.php on line *,然后我就根据提示,找到那个文件,然后错误中总是提示最后一行出错,我找到最后一行发现是</html>,晕的,这能有什么错误,找了好久才找到问题所在,拿来分享。
出现这个错误的原因就是语法错误,肯定是PHP程序的书写不规范造成,我后来一条一条看才发现,原来是PHP语句标识符错了,正常情况下应该是这样的:<?php 你的PHP语句?>,我写成了这样:<? 你的PHP语句?>,当然写成这样也不错,只是我没有在php.ini中开启短标签,所以就造成了这个错误,另外要注意,<?php后面有一个空格,如果不写也会出现这个错误,虽然这个错误是不经意间,但有时还是很难找出来,大家注意下吧。
您可能感兴趣的文章:
- PHP syntax error, unexpected $end 错误的一种原因及解决
- 记录PHP错误日志 display_errors与log_errors的区别
- PHP函数之error_reporting(E_ALL ^ E_NOTICE)详细说明
- PHP中error_reporting()函数的用法(修改PHP屏蔽错误)
- PHP异常Parse error: syntax error, unexpected T_VAR错误解决方法
- ThinkPHP页面跳转success与error方法概述
- PHP Parse Error: syntax error, unexpected $end 错误的解决办法
- php error_log 函数的使用
- ThinkPHP跳转页success及error模板实例教程
- PHP常见的6个错误提示及解决方法
相关文章推荐
- PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
- PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
- Parse error: syntax error, unexpected end of file in *.php on line * 解决方法
- &lt;?php}?&gt;格式导致错误 Parse error: syntax error, unexpected end of file in *.php on line 374
- unexpected end of file in HotNewspro\includes\directory.php on line 22
- Parse error: syntax error, unexpected $end in D:\webserver\www\test\test.php on line 27
- bin/sh -c:line 1 Syntax Error:unexpected end of file的解决方法
- bin/sh -c:line 1 Syntax Error:unexpected end of file的解决方法
- 关于Qt for Android 编译时出错/usr/bin/sh: -c: line 1: syntax error: unexpected end of file 时的解决方法
- PHP问题Parse error: syntax error, unexpected end of file in
- syntax error: unexpected end of file解决方法
- bash: /home/x/.bash_profile: line 48: syntax error: unexpected end of file的解决
- php出现如下错误: Parse error: syntax error, unexpected end of file in
- PHP关于syntax error语法错误的问题(Parse error: syntax error, unexpected end of file in xxxxxxxx)
- PHP中Notice: unserialize(): Error at offset of bytes in on line 的解决方法
- input01.sh: line 11: warning: here-document at line 4 delimited by end-of-file (wanted `EOF') input01.sh: line 12: syntax error: unexpected end of file
- 在执行shell脚本时,出现“syntax error : unexpected end of file"错误的解决方法
- PHP中Notice: unserialize(): Error at offset 109 of 615 bytes in on line 的解决方法
- Parse error: syntax error, unexpected end of file in * 的解决办法
- [php错误]PHP中Notice: unserialize(): Error at offset of bytes in on line 的解决方法