When I set localhost:8000/laravel
in a Web browser, this image appear error in laravel permission and error in database calling.
How do I solve it?
When I set localhost:8000/laravel
in a Web browser, this image appear error in laravel permission and error in database calling.
How do I solve it?
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.
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.