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

wos's avatar
Level 1

When going to local server for laravel, I get 500 error every time

So, I'm running Linux Mint and decided to try to learn Laravel for job reasons. I installed everything as instructed by the Laravel installation page, I run PHP 7.2.7 and Laravel Installer 2.0.1 (how do I check version?).

I run php artisan serve, I get no errors and I go to the page, and lo and behold - there's a 500 error. There's no error, the command line only tells me that it served 500.svg. I am lost as to what I should do at this point, I really can't continue learning if I can't even start the server.

What could I try to fix this?

Thanks

0 likes
7 replies
tykus's avatar

It could be any number of things.

If you installed Laravel using the installer, and are php artisan serve with the same user, then permissions to write to the logs should not be the issue, so first checkstorage/logs/laravel.log` to see if there are any errors logged in there.

wos's avatar
Level 1

I've got this error repeated over and over again: [2018-09-27 22:35:10] production.ERROR: No application encryption key has been specified. {"exception":"[object] (RuntimeException(code: 0): No application encryption key has been specified. at ~/Programming/plswork/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:42)

Could this be the underlying issue?

Yorki's avatar
Yorki
Best Answer
Level 11

Type php artisan key:generate into console.

6 likes
wos's avatar
Level 1

Oh my god, it works! I had some problems with that earlier because I didn't have any .env file, but I just renamed the .env.example, ran that command and then it worked!! Thanks!!! :D

1 like
Yorki's avatar

Latest laravel version installed via laravel new project does it automatically for you :)

th3dom1t's avatar

Yorki is correct, however, first need to have the .env copied from the example (also from SO, might want to do "config:cache" as well to create a cache file):

cp .env.example .env

php artisan key:generate

php artisan config:cache

5 likes
ItsAmethyst's avatar

Thanks a lot i walked straight into this problem from setting it up on git so i can work on my courses / project from my mac an desktop!

Please or to participate in this conversation.