Laravel 5.3找不到文件错误
我在一个多月前设置了一个项目,突然(今天下午)我开始出现以下错误:Laravel 5.3找不到文件错误,laravel,laravel-5,Laravel,Laravel 5,我在一个多月前设置了一个项目,突然(今天下午)我开始出现以下错误: ErrorException in Filesystem.php line 111: file_put_contents(/var/www/html/project/api/storage/framework/cache/d8/00/d800874b5dc22b961e0ee92f8d1c5a09c24ee911): failed to open stream: No such file or directory 我做了研究,
ErrorException in Filesystem.php line 111: file_put_contents(/var/www/html/project/api/storage/framework/cache/d8/00/d800874b5dc22b961e0ee92f8d1c5a09c24ee911): failed to open stream: No such file or directory
我做了研究,尝试了以下方法,但没有成功:
php artisan cache:clear
chmod -R 777 storage (I know this is not ideal)
composer update
什么都没用。在
chmod
之前,我得到了一个权限错误。我已经没有主意了。有人知道这是什么原因以及如何解决吗?您将777提供给了/storage folder,但是否也确保它与正在运行的apache服务器位于同一组中
通常apache位于www数据组中,添加存储和引导文件夹以由该组写入:
chgrp -R www-data /storage /bootstrap
分配当前用户和组的读写权限:
chmod -R ug+rw /storage /bootstrap
我有99%的把握这样做。我的服务器运行CentOS 7,不知何故,Selinux设置为强制执行,这会因为某种原因破坏Laravel。我记得第一次设置Laravel时更改了它,但不知怎的,它又恢复了 因此,将其设置为“允许”或“禁用”为我修复了它
我尝试了你的建议,但没有成功。让我感到困惑的是,这项技术已经完美地运行了一个月了。嘿,你能试试composer dump autoload吗?好像laravel正在尝试获取一个不再存在的文件。我昨天尝试了几次,但都没有成功。这是由于Selinux设置为
强制执行
。