错误在使用PHP 8.2.2的Docker中运行Laravel 9.51.0时发生。

huangapple go评论59阅读模式
英文:

Error running Laravel 9.51.0 in Docker with PHP 8.2.2

问题

我有以下环境:

  • Ubuntu 20.0.4
  • Docker 20.10.18, build b40c2f6

我使用以下命令获取了 Laravel:curl -s https://laravel.build/example-app | bash

然后我运行 cd example-app/ && ./vendor/bin/sail up 来运行 example-app,但在浏览器中打开 http://localhost/ 时出现以下错误:

无法以附加模式打开流或文件“/var/www/html/storage/logs/laravel.log”:打开流时发生无效参数错误,异常发生在尝试记录日志时:流或文件

如何修复上面的错误?我的本地开发环境设置有什么问题?

运行命令 vendor/bin/sail up 会生成错误,我不知道如何修复。

英文:

I have a:

  • Ubuntu 20.0.4
  • Docker 20.10.18, build b40c2f6

I got Laravel using the following command: curl -s https://laravel.build/example-app | bash

Then I run cd example-app/ && ./vendor/bin/sail up to run the example-app I got the following error opening http://localhost/ in a browser:

> The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Invalid argument The exception occurred while attempting to log: The stream or file

How can I fix the error above? What is wrong with my local dev environment setup?

Running command vendor/bin/sail up generates the error I don't know how to fix.

答案1

得分: 0

I've runned command: chmod -Rv 777 /var/www/html/storage/logs/ and it has solved this errors. Now Laravel app loading normally.

英文:

I've runned command: chmod -Rv 777 /var/www/html/storage/logs/ and it has solved this errors.
Now Laravel app loading normally.

huangapple
  • 本文由 发表于 2023年2月14日 03:02:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/75440180.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定