在共享主机上部署时解析错误(Laravel 4) [英] Parse Error when deploying on shared hosting ( Laravel 4 )

查看:76
本文介绍了在共享主机上部署时解析错误(Laravel 4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,我在尝试将我的应用程序部署到共享主机时遇到错误.

I for some reason am getting an error when trying to deploy my app to a shared host.

我收到此错误:

解析错误:语法错误,第411行的public_html/dev/vendor/laravel/framework/src/Illuminate/Support/helpers.php中出现意外的[[]

Parse error: syntax error, unexpected '[' in public_html/dev/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 411

function class_uses_recursive($class)
{
    $results = [];

    foreach (array_merge([$class => $class], class_parents($class)) as $class)
    {
        $results += trait_uses_recursive($class);
    }

    return array_unique($results);
}

我知道Laravel 4需要PHP> = 5.4,并且我目前在主机,开发环境(应用运行良好)上运行5.4,并且在上面的代码中我知道'[]'是较旧的array()的简写;

I am aware that Laravel 4 needs PHP >= 5.4 and I am currently running 5.4 on my host, as well as my dev environment (which the app runs fine) and in the code above I am aware that '[ ]' is shorthand for the older array();

这可能是我所忽略的东西,但是今天早上我的大脑似乎工作不正常.

This is probably something I am just overlooking but my brain seems to be not working well this morning.

提前谢谢!

推荐答案

我在Linux共享主机中遇到了同样的问题.当我将php的默认版本从5.3改为5.5时,它已经正确解决了.

I got the same problem in my linux shared hosting. when I make the default version of php from 5.3 to 5.5 it has been solved properly.

这篇关于在共享主机上部署时解析错误(Laravel 4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆