Reputation: 446
I have just installed Laravel on my host following the official site's step by step guide and created an app called core, using the command
laravel new core
after seeing the success message I uploaded everything to my host, but when i try to access the /core/public folder from the browser i get 500 error on Chrome and nothing at all on firefox. if i run the command
php artisan list
On SSH inside my core folder i get:
Status: 500 Internal Server Error
Content-type: text/html
Can anyone of you Laravel experts let me know please where did i go wrong? thanks in advance
In the error log i found:
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in ...public_html/laravel/core/public/index.php on line 50
even though i haven't touched any files, line 50 is:
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
I checked all the requirement from Laravel and my server meets them all PHP >= 5.5.9 OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension
The application key was successfully generated inside .env Also Directories within the storage and the bootstrap/cache directories are writable by the web server with permission 755
Upvotes: 1
Views: 1940
Reputation: 10372
Unexpected class for Kernel::class
implies to me that you are running a version of PHP lower than 5.5. Laravel only works for 5.5.9+.
My guess is your server provider claims to have PHP 5.5+ support, but the boxes may come with 5.4 installed on them. You will need to contact your server admin to get them to upgrade it if you cannot upgrade it yourself.
PHP 5.5 is required because the ::class
syntax was added in that version.
Upvotes: 1