gpt4 book ai didi

laravel - 流或文件 "/app/storage/logs/laravel.log"无法打开 : failed to open stream:Permission denied

转载 作者:行者123 更新时间:2023-12-04 10:28:34 25 4
gpt4 key购买 nike

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

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



我试图从我的终端运行它。我正在使用窗口 PC 和 Vscode

chmod -R 775 storage

chmod -R 775 bootstrap/cache



当我运行它时,它返回

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"
]

我不知道如何解决这个问题。我需要帮助

最佳答案

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

请查看 https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard并记下部署部分下的第 1 步和第 3 步,它们设置了 APP_STORAGE/tmp 的路径,以便它可写。

关于laravel - 流或文件 "/app/storage/logs/laravel.log"无法打开 : failed to open stream:Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60526252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com