It seems the permission issue.
Check this discussion and take the appropriate sep for you. https://stackoverflow.com/questions/23411520/how-to-fix-error-laravel-log-could-not-be-opened
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
php artisan migrate
UnexpectedValueException : The stream or file "/opt/lampp/htdocs/blog/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
at /opt/lampp/htdocs/blog/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:108 104| } 105| restore_error_handler(); 106| if (!is_resource($this->stream)) { 107| $this->stream = null;
108| throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url)); 109| } 110| } 111| 112| if ($this->useLocking) {
Exception trace:
1 Monolog\Handler\StreamHandler::write() /opt/lampp/htdocs/blog/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:39
2 Monolog\Handler\AbstractProcessingHandler::handle() /opt/lampp/htdocs/blog/vendor/monolog/monolog/src/Monolog/Logger.php:344
Please use the argument -v to see more details.
Please or to participate in this conversation.