流或文件"/app/storage/logs/laravel.log"位于无法打开:无法打开流:权限被拒绝 [英] The stream or file "/app/storage/logs/laravel.log" could not be opened: failed to open stream:Permission denied

查看:163
本文介绍了流或文件"/app/storage/logs/laravel.log"位于无法打开:无法打开流:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在本地工作时,一切正常.但是当我在Google Cloud上部署时,会出现此错误

While I work locally, everything works fine. But when I deploy on Google Cloud I have this error

无法打开流或文件"/app/storage/logs/laravel.log":无法打开流:权限被拒绝

The stream or file "/app/storage/logs/laravel.log" could not be opened: failed to open stream:Permission denied

我试图从我的终端上运行它.我正在使用Windows PC和Vscode

I have tried to run this from my terminal. I am using window PC and Vscode

chmod -R 775存储

chmod -R 775 storage

chmod -R 775引导程序/缓存

chmod -R 775 bootstrap/cache

运行此命令时,它将返回

When I run this, it returns

chmod无法识别为内部或外部命令,可操作程序或批处理文件.

chmod is not recognized as internal or external commands, operable program or batch file.

我也尝试过这种方法

"post-install-cmd": [
            "chmod -R 775 storage",
            "chmod -R 775 bootstrap/cache",
            "php artisan optimize:clear"
]

我不知道该如何解决.我需要帮助

I don't know how to solve this. I need help

推荐答案

Google Cloud是只写文件系统.对于需要由应用程序写入的目录,您将需要进行一些修改.

Google Cloud is a write only filesystem. For directories which need to be written into by the application, you will need to make some modifications.

请参阅 https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard 并记下deploy部分下的第1步和第3步,该步骤将 APP_STORAGE 路径设置为/tmp,以便可写.

Please see https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard and make note of steps 1 and 3 under the deploy section, which set the APP_STORAGE path to /tmp so that it will be writable.

这篇关于流或文件"/app/storage/logs/laravel.log"位于无法打开:无法打开流:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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