-2

When I set localhost:8000/laravel in a Web browser, this image appear error in laravel permission and error in database calling.

enter image description here

How do I solve it?

Nimesh Neema
  • 1,528
  • 2
  • 17
  • 44
  • Do you have the proper permission on your storagefolder? – Christophe Hubert Apr 26 '20 at 12:46
  • I see two issues in the images. 1. Seems you didn't set necessary permission to storage folder. 2. You didn't set the correct database name in the env file. Can you check those 2 things? It also answered well in this question https://stackoverflow.com/questions/30639174/how-to-set-up-file-permissions-for-laravel – Hashan Apr 26 '20 at 15:16
  • Does this answer your question? [How to set up file permissions for Laravel?](https://stackoverflow.com/questions/30639174/how-to-set-up-file-permissions-for-laravel) – Reza Ahmadi Apr 26 '20 at 20:22
  • try this command: `php artisan config:cache` – Inzamam Idrees Apr 27 '20 at 10:32

2 Answers2

2

Most likely, it's because you haven't run this command after creating a project:

php artisan generate:key

This generates an application key in your .env, so that it can be used to encrypt your content.

If that doesn't work (which seems to be the case), looks like you tried to query your database with the wrong configurations. In the root directory, there should be a .env file with the parameters DB_DATABASE=laravel. Edit that to your actual name of your database and fill out other params like the DB_USERNAME and DB_PASSWORD.

Also, as another person mentioned below, you may want to use chmod to change permissions of your Laravel files.

Jim Forstall
  • 110
  • 1
  • 8
0

You need to have special permissions in your folders, as per the doc:

Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run.

Make sure those are in place.

Christophe Hubert
  • 2,833
  • 1
  • 12
  • 25