Laravel 5.0:迁移刷新错误

时间:2016-04-03 05:35:02

标签: php laravel-5 migration

我是laravel的绝对初学者。

我想在我的数据库中进行一些更改。但是当我尝试刷新数据库时,我会继续处理下面的错误。

在发表这篇文章之前,我用Google搜索了很多内容并阅读了很多参考文献。但是,这些都没有奏效,并帮助我解决了错误。

之前有没有人遇到此错误?任何意见,将不胜感激。提前谢谢。

  

PHP致命错误:未捕获异常'UnexpectedValueException',消息'流或文件“/web/journal/storage/logs/laravel-2016-04-03.log”无法打开:无法打开流:权限拒绝'在/web/journal/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87堆栈跟踪:#0 /web/journal/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php (88):Monolog \ Handler \ StreamHandler-> write(Array)#1 /web/journal/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37):Monolog \ Handler \ RotatingFileHandler-> write(Array)#2 /web/journal/vendor/monolog/monolog/src/Monolog/Logger.php(336):Monolog \ Handler \ AbstractProcessingHandler-> handle(Array)#3 / web / journal / vendor / monolog /monolog/src/Monolog/Logger.php(615):Monolog \ Logger-> addRecord(400,'exception'Unex ...',Array)#4 / web / journal / vendor / laravel / framework / src / Illuminate / Foundation / Exceptions / Handler.php(47):Monolog \ Logger->错误('例外'Unex ......')#5 / web / jour nal / app / Exceptions / Handler.php(27):Illuminate \ Foundation \ in /web/journal/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87 PHP致命错误:未捕获异常'UnexpectedValueException'消息“流或文件”/web/journal/storage/logs/laravel-2016-04-03.log“无法打开:无法打开流:权限被拒绝'/ web / journal / vendor / monolog / monolog / src / Monolog / Handler / StreamHandler.php:87Stack跟踪:#0 /web/journal/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88):Monolog \ Handler \ StreamHandler->写(数组)#1 /web/journal/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37):Monolog \ Handler \ RotatingFileHandler-> write(数组)#2 / web / journal / vendor / monolog / monolog / src / Monolog / Logger.php(336):Monolog \ Handler \ AbstractProcessingHandler-> handle(Array)#3 /web/journal/vendor/monolog/monolog/src/Monolog/Logger.php(615) :Monolog \ Logger-> addRecord(400,'exception'Symf ...',Array)#4 / web / jou rnal / vendor / laravel / framework / src / Illuminate / Foundation / Exceptions / Handler.php(47):Monolog \ Logger->错误('例外'Symf ...')#5 / web / journal / app / Exceptions /Handler.php(27):第87行的/web/journal/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php中的照明\基础\

1 个答案:

答案 0 :(得分:1)

运行

composer dump-autoload
在项目内部,在运行工匠之前

添加www-data组并将权限写入文件夹/ storage / logs /。错误是关于写入日志文件的权限。需要更改/ storage / logs /的权限。然后只会看到真正的错误

sudo chmod -R 777 storage

有助于更改权限