Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chlebta's avatar

Laravel5 : deployement Issue

Hello, I'm trying to deploy my laravel project so I folwed this tuto : http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

But now when I'm trying to acces to my index.php page I get this error : 500 Internal Server Error And this is my .htaccess file content :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

and this is the error in error_log file : [13-May-2015 11:25:08 Europe/Berlin] PHP Parse error: syntax error, unexpected '[' in /home/krizma/neverask/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 383

0 likes
10 replies
chlebta's avatar

It's the line 409 in github this is my version :

if ( ! function_exists('resource'))
{
    /**
     * Route a resource to a controller.
     *
     * @param  string  $name
     * @param  string  $controller
     * @param  array   $options
     * @return void
     */
    function resource($name, $controller, array $options = [])  // this is the line 383
    {
        return app('router')->resource($name, $controller, $options);
    }
}

bashy's avatar

And post the Route::resource() you have in routes.php?

RachidLaasri's avatar
Level 41

The problem here is that your PHP version doesn't support the new array syntax [], check the documentation and make sure you have the minimum requirements.

bashy's avatar

@RachidLaasri Good catch, I always assume they're using the right PHP versions since Laravel 5 requires >= 5.4

I guess that's it.

RachidLaasri's avatar

@bashy i believe it's a shared hosting, you will always face these kinda problems on shared hosting.

chlebta's avatar

@RachidLaasri Thank's I've updated my php version and now I'm getting this error :

FatalErrorException in Encrypter.php line 303: Call to undefined function Illuminate\Encryption\mcrypt_get_iv_size()
ErrorException in EncryptionServiceProvider.php line 16: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'

Please or to participate in this conversation.