简体   繁体   中英

Parse Error when deploying on shared hosting ( Laravel 4 )

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM