1

i just uploaded my website to a server and i'm currently trying to configure it, have had a lot of issues especially with changing the paths, right now my main issue is this:

PHP Parse error:  syntax error, unexpected '[' in /hermes/bosoraweb097/b1299/dom.epchurchadentaorg/xxxxxxxxxxxxx.com/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 49

So i went to that file to check:

if ( ! function_exists('app'))
{
    /**
     * Get the available container instance.
     *
     * @param  string  $make
     * @param  array   $parameters
     * @return mixed|\Illuminate\Foundation\Application
     */
    function app($make = null, $parameters = []) // Line 49 error
    {
        if (is_null($make)) return Container::getInstance();

        return Container::getInstance()->make($make, $parameters);
    }
}

Now personally i can't see anything wrong with it and it works just fine on my localhost, could there be another issue?

4
  • php version on server and version supported by the file mismatch Commented Mar 25, 2015 at 7:23
  • You have an old version of PHP which does not support the short array syntax (i.e. [] instead of array()). If that code is from Laravel then it does not support your version of PHP. If you wrote the code, then you need to use array(). If you are unable to upgrade PHP then you are most likely out of luck. Commented Mar 25, 2015 at 7:24
  • Need to change version of php. take help from this link:- stackoverflow.com/questions/25038187/… Commented Mar 25, 2015 at 7:24
  • Lol why the downvote? I wouldn't have known this if i hadn't asked, thank you all though. Commented Mar 25, 2015 at 14:53

1 Answer 1

2

The problem here is that your PHP version is not up to date with the Laravel 5 requirements. For Laravel 5 you need:

The Laravel framework has a few system requirements:

PHP >= 5.4 
Mcrypt PHP Extension 
OpenSSL PHP Extension 
Mbstring PHP
Extension Tokenizer PHP Extension

I think your server has 5.3

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.