【问题标题】:Laravel: running artisan gives me "Unexpected character in input" errorLaravel:运行工匠给我“输入中的意外字符”错误
【发布时间】:2013-02-05 04:53:54
【问题描述】:

当我在生产环境(Debian Linux,私有服务器)中运行php artisan list 时,出现以下错误:

Warning: Unexpected character in input:  
'\' (ASCII=92) state=1 in /home/user/app/artisan on line 46

Parse error: syntax error, unexpected T_STRING in 
/home/user/app/artisan on line 46

为什么会这样,我该如何解决?

【问题讨论】:

    标签: laravel laravel-4


    【解决方案1】:

    所以这一行有一个解析错误:

    $artisan = Illuminate\Console\Application::start($app);
    

    PHP 解析器没想到那里有一个\,它用于namespaces,它是在 PHP 5.3 中引入的,这意味着您运行的是较旧的 PHP 版本。您应该将您的 PHP 安装更新到至少 PHP 5.3。

    我的托管公司同时安装了 PHP 5.2 和 5.3,所以我只运行:

    /usr/local/php53/bin/php artisan migrate
    

    【讨论】:

      猜你喜欢
      • 2020-06-02
      • 2016-08-31
      • 2018-07-23
      • 2018-10-06
      • 2019-04-20
      • 2018-05-07
      • 2018-06-03
      • 2017-10-04
      • 2018-04-01
      相关资源
      最近更新 更多