php环境引起的"syntax error unexpected $end"
2013-08-16 09:54
323 查看
今天在网上淘了一段php和javascript的二级联动下拉菜单的代码。本地运行的时候,一直提示错误
syntax error unexpected $end
本来还以为是括号或者标签没有用好,但是仔细检查了好多遍都没有问题。
于是在网上找到了这篇文章:http://webteam.blog.51cto.com/863355/787895
问题得以解决。
出现问题的原因是php语言使用不规范引起的,有的地方开头使用"<?php",有的地方用"<?",造成匹配问题。
有“问题”的代码如图
php5中短标签是默认处于关闭状态的:
解决方法就是把Off修改成On
打开php文件夹中的php.ini
找到short_open_tag=Off 修改成short_open_tag=On
问题解决,哦也!
转载地址:http://zhaozhe0531.blog.163.com/blog/static/217162061201331234824412/
syntax error unexpected $end
本来还以为是括号或者标签没有用好,但是仔细检查了好多遍都没有问题。
于是在网上找到了这篇文章:http://webteam.blog.51cto.com/863355/787895
问题得以解决。
出现问题的原因是php语言使用不规范引起的,有的地方开头使用"<?php",有的地方用"<?",造成匹配问题。
有“问题”的代码如图
php5中短标签是默认处于关闭状态的:
解决方法就是把Off修改成On
打开php文件夹中的php.ini
找到short_open_tag=Off 修改成short_open_tag=On
问题解决,哦也!
转载地址:http://zhaozhe0531.blog.163.com/blog/static/217162061201331234824412/
相关文章推荐
- php环境变化引起的"syntax error unexpected $end"
- linux shell判断一个文件名判断它是目录还是文件以及在windows下出现"syntax error near unexpected token"的解决方法
- SHELL syntax error:unexpected end of file 提示错误
- PHP Parse Error: syntax error, unexpected $end 错误的解决办法
- 解决 “Uncaught SyntaxError: Unexpected end of JSON input” 可能有用的方法
- npm install出现"Unexpected end of JSON input while parsing near"错误解决方法
- 用git 下载android x86出错(syntax error near unexpected token `newline',`<!DOCTYPE HTML PUBLIC "-//IETF//)
- 解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题
- 关于PHP Parse Error: syntax error, unexpected $end 错误的解决办法
- PHP Parse Error: syntax error, unexpected $end 错误的解决办
- Hibernate error : org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree
- PHP Parse Error: syntax error, unexpected $end 解决方法
- DedeCMS Error:Tag disabled:"php" more...!
- PHP关于syntax error语法错误的问题(Parse error: syntax error, unexpected end of file in xxxxxxxx)
- 这个惊叹号不能少,否则引发“syntax error `end of file' unexpected”的错误
- bootstrap中下拉菜单点击事件 uncaught syntaxerror unexpected end of input异常问题
- 关于PHP Parse Error: syntax error, unexpected $end 错误的解决办法
- 关于PHP Parse Error: syntax error, unexpected $end 错误的解决办法
- Linix登录报"/etc/profile: line 11: syntax error near unexpected token `$'{\r''"
- syntax error near unexpected token 和 Linux Shell syntax error: unexpected end of file