PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
出现这个错误的原因就是语法错误,肯定是PHP程序的书写不规范造成,PHP语句标识符错了,没有在php.ini中开启短标签!八成是这个原因,啊啊啊!
今天在写PHP程序的时候总是出现这样的错误:Parse error: syntax error, unexpected end of file in *.php on line *,然后我就根据提示,找到那个文件,然后错误中总是提示最后一行出错,我找到最后一行发现是</html>,晕的,这能有什么错误,找了好久才找到问题所在,拿来分享。
出现这个错误的原因就是语法错误,肯定是PHP程序的书写不规范造成,我后来一条一条看才发现,原来是PHP语句标识符错了,正常情况下应该是这样的:<?php 你的PHP语句?>,我写成了这样:<? 你的PHP语句?>,当然写成这样也不错,只是我没有在php.ini中开启短标签,所以就造成了这个错误,另外要注意,<?php后面有一个空格,如果不写也会出现这个错误,虽然这个错误是不经意间,但有时还是很难找出来,大家注意下吧。
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 * 解决方法
Parse error: syntax error, unexpected end of file in *.php on line * 解决方法 这篇文章主要介绍了PHP错误Parse erro ...
- PHP关于syntax error语法错误的问题(Parse error: syntax error, unexpected end of file in xxxxxxxx)
在php程序出现类似 Parse error: syntax error, unexpected end of file in xxxxxxxx on line xx 的错误. 如图 如果发现php ...
- Parse error: syntax error, unexpected T_PUBLIC in 问题解决
class 类中 public function _getInfo($sn){ $title = ''; $_array = explode('~', $sn); ...
- *2 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '[' in /application/nginx-1.6.3/html/zabbix/index.php on line 32" while reading response header from upstream, clien
今天呢想学习一下zabbix监控一下我的服务情况,然后就开始安装我的zabbix服务,首先LNMP环境准备好了,Nginx版本为1.6.3,php版本为5.3.27,MySQL版本为二进制包安装的5. ...
- Parse error: syntax error, unexpected '__data' (T_STRING), expecting ',' or ')'
使用laravel时,建立view文件引入dafault文件时报错: Parse error: syntax error, unexpected '__data' (T_STRING), expect ...
- Parse error: syntax error, unexpected 'class' (T_CLASS)
电脑坏了重新下载代码. 结果报错 Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_ST ...
- 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了
页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...
- 使用帝国备份王软件提示 Parse error: syntax error, unexpected end of file
使用帝国备份王软件提示 Parse error: syntax error, unexpected end of file时, 可以尝试一下方法: 1.php.ini要把short_open_tag ...
- linux篇-Parse error: syntax error, unexpected ‘new’ (T_NEW) in /usr/local/nginx/html/cacti/lib/adodb
1首先这是基于lnmp模式进行的 2yum安装 yum -y install httpd mysql mysql-server php php-mysql php-json php-pdo 3lib库 ...
随机推荐
- Linux下mysql允许远程连接怎么设置
1.root用户登录到mysql数据库代码示例:/usr/local/mysql/bin/mysql -u root -p (输入密码进入mysql)2.进入mysql,输入:代码示例:use mys ...
- snapshot与release
总结自:https://www.jianshu.com/p/084fd2408d9a 这两个概念是用于描述jar包,jar包提供给其他系统作为依赖. 1. snapshot版本代表不稳定.尚处于开发中 ...
- .net 数据缓存(二)之Redis部署
现在的业务系统越来复杂,大型门户网站内容越来越多,数据库的数据量也越来愈大,所以有了“大数据”这一概念的出现.但是我们都知道当数据库的数据量和访问过于频繁都会影响系统整体性能体验,特别是并发量高的系统 ...
- SaltStack匹配target-第六篇
练习内容 Salt远程执行中目标选择常用的模式 1.通配符匹配 2.正则表达式匹配 3.List支持 4.Grains匹配 5.IP地址匹配 6.混合匹配 7.Node groups 远程执行格式 t ...
- sphinx 安装使用
一.linux(centos)下安装源码包 1.下载 wget http://sphinxsearch.com/files/sphinx-2.3.1-beta.tar.gz 2.安装 切换目录到 ...
- Restful Api CRUD 标准示例 (Swagger2+validator)
为什么要写这篇贴? 要写一个最简单的CRUD 符合 Restful Api 规范的 一个Controller, 想百度搜索一下 直接复制拷贝 简单修改一下 方法内代码. 然而, 搜索结果让我无 ...
- angularjs定时任务的设置与清除
人们似乎常常将AngularJS中 的$timeOut() $interval()函数看做是一个内置的.无须在意的函数.但是,如果你忘记了$timeOut()$interval()的回调函数将会造成 ...
- ItemsControl控件-----常用的
常用的ItemsControl控件有:ListBox.ComboBox.TreeView.DataGrid等等.(小结:均是“多项”控件,多项 对应 集合,单项 对应 元素) ItemsControl ...
- flask学习(七):URL反转
1. 什么叫反转URL:从视图函数到url的转换叫做反转url 2. 反转url的用处: 1) 在页面重定向的时候,会使用url反转 2) 在模板中,也会使用url反转 3. 实例: 打印出了url
- hihocoder1457
http://hihocoder.com/problemset/problem/1457 找不重复子串的和 topo序搞一搞,用父亲更新儿子节点的val,记得乘上节点数 //#pragma comme ...