解析错误:语法错误,意外';'
我正在将我的网站从 PHP 4 迁移到 5,
但我在版本 5 服务器上不断收到此错误:
解析错误:语法错误,意外 ';'在 /var/www/vhosts/****.php 上 第1688行
当我检查代码时,它是这样的:
<?=#something here being commented out?>
这在 v4 中工作正常,但现在它创建了一个错误。我真的不明白这个错误,因为整行中的任何地方都没有 ;
?
我可以删除该行,但我想知道为什么这个错误首先会发生,除了追查每次发生的错误之外,我是否还能做其他事情?
谢谢!!
I am migrating my site from PHP 4 to 5
I keep getting this error on the version 5 server:
Parse error: syntax error, unexpected
';' in /var/www/vhosts/****.php on
line 1688
I when I check the code its something like this:
<?=#something here being commented out?>
This worked fine in v4 but now its creating an Error. I really do not understand the error either because there is no ;
in the entire line anywhere?
I can just delete the line but I am wondering why this error is happening in the first place and if there is something else I can do besides hunting down every occurrence of that?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这:
翻译成这样:
你只需要修复我假设的语法。
This:
Translates into this:
You just have to fix the syntax I presume.
有一个设置可以使
成为
的简写 - 确保已启用。
There is a setting that enables
<?
to be shorthand for<?php
- ensure that is enabled.意想不到的';'更多地表明它不期望命令结束。在您的代码中,您有一个速记开放标记。你基本上是在告诉它回显,而不是在你这样做时向它传递一个参数:
如果你将其缩短为:
你就会安全了。
unexpected ';' indicates more that it was not expecting the end of a command. In your code, you have a shorthand open tag. You're basically telling it to echo and not passing it an argument when you do:
If you shorten this to:
You would be safe.