PHP 在本地计算机上损坏代码,但在临时服务器上工作
我在这里遇到一个奇怪的问题,我有一段代码:
<?php
if ($node->nid == "1") {
include 'front.tpl.php';
return;
} else {
?>
<div id="left-col" class="grid_9">
<h1><?php print $title ?></h1>
<hr />
<?php global $user;if ( $is_admin ) { ?>[<a href="/node/<?php print $node->nid ?>/edit">Edit</a>]<? } ?>
<?php if ($show_messages) { print $messages; } ?>
<?php print $help ?>
<?php print $content; ?>
</div>
<?php } ?>
这个确切的代码在登台服务器上运行良好,我实际上只是使用 XAMPP 安装了一个 LAMP 堆栈并从服务器下载了代码。
PHP 现在抛出这个错误:
Parse error: syntax error, unexpected $end in F:\Workspace\xx\xx\xx\xx\xx\node.tpl.php on line 19
有人知道它可能是什么吗?我有一种感觉“可能”是由于标签的跳入和跳出造成的,但我不确定,任何人都可以对此有所了解。 (这可能是服务器问题,在这种情况下,我也很乐意就需要向正确方向进行哪些 php.ini 设置提供建议!
提前致谢。
I'm having a strange issue here, i have this bit of code:
<?php
if ($node->nid == "1") {
include 'front.tpl.php';
return;
} else {
?>
<div id="left-col" class="grid_9">
<h1><?php print $title ?></h1>
<hr />
<?php global $user;if ( $is_admin ) { ?>[<a href="/node/<?php print $node->nid ?>/edit">Edit</a>]<? } ?>
<?php if ($show_messages) { print $messages; } ?>
<?php print $help ?>
<?php print $content; ?>
</div>
<?php } ?>
This exact code is working fine on the staging server, i've litrally just installed a LAMP stack using XAMPP and downloaded the code from the server.
PHP is now throwing this error:
Parse error: syntax error, unexpected $end in F:\Workspace\xx\xx\xx\xx\xx\node.tpl.php on line 19
Anyone have any ideas what it could be? i have a feeling it "might" be due to the jumping in and out of tags but i'm not certain, can anyone shed some light on this. (this might be a server issue in which case i will also happily take advice on what php.ini settings need to be poked in the right direction!
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的猜测是服务器没有打开短标签支持。
My guess is the server doesn't have short tag support turned on.