I was using migration with a database. Then i removed that database and created new one. Then i created migration files from the terminal via php artisan make:migration create_users
.
Then i came back and tried to run the migration and it throws the following error with php artisan migrate
Error:
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/opt/lampp/htdocs/laravel/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /opt/lampp/htdocs/laravel/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:95
And also a few more.
I googled and found that composer dump-autoload
wil work, But it didn't and composer dump-autoload
throws the same error.
php artisan migrate:reset
throws the same error as php artisan migrate:reset
.
Thanks
Change Permission of log folder of laravel
Give Read & Write permission
storage/logs
Changing Database:
1: Change DB name in config/database.php
2: root/.env DB_DATABASE=databasename
It's not the problem of autoloading. It is a problem of file permissions. Check if webserver can write to the storage/logs
directory.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.