首页 > 解决方案 > 从 Laravel 我无法打开流:权限被拒绝

问题描述

我使用 Laravel 5.4 并在 Web 服务器上收到如下错误

PHP致命错误:未捕获的ErrorException:file_put_contents(/github/myweb/monitor/storage/framework/views/b38c71581503e85762ce2fe49a8bis726b1164d9.php):无法打开流:权限被拒绝n /github/myweb/monitor/vendor/laravel/framework/src/ Illuminate/Filesystem/Filesystem.php:122\n堆栈跟踪:\n#0 [内部函数]:

当我在本地进行测试时,一切都很好,但是在将代码推送到服务器后,我收到了路径错误'/github/myweb/'。我想要这样的路径

/var/www/master/monitor

如何'/github/myweb/'从路径中删除前缀我不知道它来自哪里

怎么了?

标签: phplaravel

解决方案


首先清除缓存,

php artisan config:clear
php artisan config:cache

然后运行sudo chmod -R 755 storage/

或者,您可以删除 bootstrap/cache/config.php


推荐阅读