Reputation: 5608
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
Upvotes: 0
Views: 5828
Reputation: 1743
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
Upvotes: 3
Reputation: 4531
It's not the problem of autoloading. It is a problem of file permissions. Check if webserver can write to the storage/logs
directory.
Upvotes: 0