Parse Error when deploying on shared hosting ( Laravel 4 )

三世轮回 提交于 2019-12-10 20:28:21

问题


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

I am getting this error :

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);
}

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.

Thanks in advance!


回答1:


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.



来源:https://stackoverflow.com/questions/25038187/parse-error-when-deploying-on-shared-hosting-laravel-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!