12

After installing laravel in blog directory, when I try to check it runs normally or not by accessing localhost/blog/public it shows 500 Server error like this screenshot :

enter image description here

I've tried to grant apache with mod_rewrite and it didn't help.

I installed laravel with XAMPP in Windows.

======

UPDATE : Here is the log file in the storage/logs/ and .env file link

9 Answers9

33

do you have .env file

in terminal

cp .env.example .env

php artisan key:generate

chmod 777 -R  storage
Şafak Çıplak
  • 889
  • 6
  • 12
6

you must execute these commands

php artisan key:generate
php artisan config:cache

if it doesn't work your .env file replace with APP_KEY=base64:jxfiwITVfhauwt6clRR2plSXNg+KHlDbgIUQYIXvkVI=

Şafak Çıplak
  • 889
  • 6
  • 12
3

I face the same issue with Laravel 5.8 but it was online. The way to resolve was to create a .env file which was missing after I transferred it from localhost. Also transfer all it's content into the new .env file.

Site Antipas
  • 141
  • 1
  • 4
2

I also met this problem. My solution is

  1. create .env file from .evn.example
  2. generate key by using this command php artisan key:generate
1

In my case .env file was added in .gitignore so that's why when I cloned my Git repository on server I didn't get it there so that was the root cause why I was getting 500 error on server without any clue or error log. So the issue was fixed by uploading .env file on server -OR- removing .env entry in .gitignore file the committing it in Git repository before taking Git pull on server.

Ahmed Numaan
  • 1,034
  • 1
  • 10
  • 26
0

Please check following things 1. Composer update /install 2. Check storage folder has correct permission

And other steps mentioned in above reply.

San K
  • 223
  • 1
  • 5
0

Refactor the file name .env.example to .env which could found in the root directory . Then check in that file APP_debug =true . If that's okk then open cmd and php artisan key:generate

Then again start the server .

0

You must try this:

php artisan key:generate **strong text**

and give the 777 permission for this project.**strong text** then run php artisan serve command.

Pingolin
  • 3,161
  • 6
  • 25
  • 40
0

If u give full access to Your Root Folder.Check Once. Then Give Full Access to All sub-folders In your application.

Open this Link - https://github.com/laravel/laravel

Copy the Below Files -

.editorconfig
.env.example
.gitattributes
.gitattributes
.gitattributes

And Paste it in You Application Root Folder. Now Run The file. Its working fine For me. If u have any pblm in php version or config laravel can't install the above files. SO u need to download it and Paste it in your Root folder.

If your pblm is Still not solved. Dont get tired. Just download the laravel files from git, it surely works.

Bala Murugan
  • 479
  • 5
  • 10