【问题标题】:codeigniter bonfire php error after installing安装后codeigniter bonfire php错误
【发布时间】:2013-09-20 02:20:33
【问题描述】:

我正在尝试安装 codeigniter 篝火。单击创建用户名屏幕上的安装按钮后,需要一些时间,然后加载此页面。我看了一些关于如何安装 bonfire 的教程,所以我知道这不是我应该看到的。

无论如何,我将 RewriteBase 更新为 /bonfire/,正如它所说..现在当我尝试访问 localhost/bonfire/index.php 时出现此错误

解析错误:语法错误,意外'yield' (T_YIELD),期待 标识符 (T_STRING) 在 /opt/lampp/htdocs/bonfire/bonfire/application/libraries/template.php 在第 305 行

这是第 305 行的代码

public static function yield()
{
    $output = '';

    if (self::$debug) { echo 'Current View = '. self::$current_view; }

    self::load_view(self::$current_view, NULL, self::$ci->router->class .'/'. self::$ci->router->method, FALSE, $output);

    Events::trigger('after_page_render', $output);

    return $output;

}//end yield()

我在 bonfire 论坛上找到了这个链接来解释错误。 Bonfire forums link

它说要使用 PHP 5.4,这就是我正在使用的。我的操作系统是 Linux Zorin,我使用的是 Lampp,所以我不确定这是否是权限问题。

提前谢谢,如果您需要更多信息,请告诉我。

【问题讨论】:

    标签: php linux codeigniter netbeans bonfire


    【解决方案1】:

    有点晚了,但希望能有所帮助。

    您可以在 cibonfire 中更改静态函数 yield 的名称,如下所示:

    public static function yield()
    

    到:

    public static function yield_content()
    

    这对我来说非常有效。

    【讨论】:

      【解决方案2】:

      我认为在 LAMP 中 PHP 的版本是 5.5 + 的东西。在 PHP 5.5 中有一个函数名称为 yield,因此您必须将 LAMP PHP 版本降级到 5.4 或在 Bonfire 文件系统中进行修改。

      对于篝火的改变你可以通过这个链接,你的问题已经解决了。

      https://github.com/illuminate/view/commit/d37abcecc7d79d00bf5f22b134d152ca765f26b2

      您也可以查看此链接Laravel 4 syntax error out-of-the-box

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-10-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-09-15
        • 2018-01-30
        相关资源
        最近更新 更多