从Laravel,我无法打开流:权限被拒绝 [英] From Laravel I got failed to open stream: Permission denied

查看:99
本文介绍了从Laravel,我无法打开流:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Laravel 5.4,并在Web服务器上出现以下错误

I use Laravel 5.4 and got the error at Web Server as below

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\nStack trace:\ n#0 [内部函数]:

PHP Fatal error: Uncaught ErrorException: file_put_contents(/github/myweb/monitor/storage/framework/views/b38c71581503e85762ce2fe49a8bis726b1164d9.php): failed to open stream: Permission denied n /github/myweb/monitor/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122\nStack trace:\n#0 [internal function]:

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

When I tested on local every thing is fine, but after pushing code to server, i am getting error for path '/github/myweb/' where it's from. I want path like this

/var/www/master/monitor

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

How to remove prefix '/github/myweb/' from path I don't know where it's from

怎么了?

推荐答案

首先清除缓存,

php artisan config:clear
php artisan config:cache

然后运行 sudo chmod -R 777 storage/

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

Alternatively you can delete your bootstrap/cache/config.php

这篇关于从Laravel,我无法打开流:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆