Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP解析错误:语法错误,PHP5.5.9中出现意外的文件结尾_Php_Parse Error - Fatal编程技术网

PHP解析错误:语法错误,PHP5.5.9中出现意外的文件结尾

PHP解析错误:语法错误,PHP5.5.9中出现意外的文件结尾,php,parse-error,Php,Parse Error,我有以下代码: <?php if ($template['issue']['raw_state'] == 0 && ($helper->user_coordinator($template['issue']['id']) || isset($nparams['tid']))): ?> <a href="?id=<?php echo $this->id('cause_form', 'id', $template['issue']['id'

我有以下代码:

<?php if ($template['issue']['raw_state'] == 0 && ($helper->user_coordinator($template['issue']['id']) || isset($nparams['tid']))): ?>
    <a href="?id=<?php echo $this->id('cause_form', 'id', $template['issue']['id']) ?>">
        <?php echo $bezlang['add_cause'] ?>
    </a>
<? endif ?>

它在我的大多数服务器上运行良好,但在其中一台服务器上,我收到一个错误:

PHP分析错误:语法错误,中的文件意外结束 /var/www/dokuwiki/lib/plugins/bez/tpl/issue_causes.php,第19行

这个代码有什么问题

整个文件issue_cause.php:

<?php include "issue_box.php" ?>

<div class="bds_block" id="bez_causes">
    <h1><?php echo $bezlang['causes'] ?> <span>(<?php echo count($template['causes']) ?>)</span></h1>
    <div class="bds_block_content">
        <?php foreach ($template['causes'] as $cause): ?>
            <?php include "cause.php" ?>
        <?php endforeach ?>
    </div>
    <?php if ($template['issue']['raw_state'] == 0 && ($helper->user_coordinator($template['issue']['id']) || isset($nparams['tid']))): ?>
        <a href="?id=<?php echo $this->id('cause_form', 'id', $template['issue']['id']) ?>">
            <?php echo $bezlang['add_cause'] ?>
        </a>
    <? endif ?>
</div>

<?php include "removal_confirm.php" ?>

()
您能用

第19行,但此处仅显示17行。你确定你在这里给我们看的是正确的真实文件吗?你需要在endofrach和endif后面加一个分号,比如
他没有在
的任何地方使用过。确保所有服务器上都启用了短标记。更多的问题是“为什么我的代码不起作用”你是对的。我怎么能忽视这一点?老问题。
Could you replace <? endif ?> with <?php endif ?>