gpt4 book ai didi

php - Laravel 在 "storage/logs"处没有现有目录

转载 作者:可可西里 更新时间:2023-11-01 00:39:08 25 4
gpt4 key购买 nike

我想使用 Docker 运行 Laravel 5.7 应用程序。我的容器启动正常,但当我尝试在浏览器中运行应用程序时出现错误。

There is no existing directory at"/Users/user/projects/laravel/application/storage/logs" and its notbuildable: Permission denied

我用...更改了整个项目的权限

sudo chmod -R 777 /Users/user/projects/laravel/application

然而,一切都没有改变。这个问题还能如何解决?

这里是 docker-compose.yml 文件

version: '3'
services:
web:
image: nginx
volumes:
- "./vhosts.conf:/etc/nginx/conf.d/vhosts.conf"
- "./application/public:/var/www/html/application/public"
- "./:/var/www/html"
- "./logs/nginx/error.log:/var/log/nginx/error.log"
- "./logs/nginx/access.log:/var/log/nginx/access.log"
ports:
- "8000:80"
environment:
- NGINX_HOST=ld2.web
restart: always
depends_on:
- php
php:
image: php:7.2-fpm
restart: always
volumes:
- "./application/storage/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./application/public:/var/www/html/application/public"
- "./:/var/www/html"

这是 ls -ls application 的输出

drwxrwxrwx  26 user  staff     832 Oct 24 14:50 .
drwxrwxrwx 8 user staff 256 Oct 24 01:06 ..
-rwxrwxrwx 1 user staff 213 Sep 4 16:12 .editorconfig
-rwxrwxrwx 1 user staff 704 Oct 24 00:38 .env
-rwxrwxrwx 1 user staff 655 Sep 4 16:12 .env.example
-rwxrwxrwx 1 user staff 111 Sep 4 16:12 .gitattributes
-rwxrwxrwx 1 user staff 177 Sep 4 16:12 .gitignore
drwxrwxrwx 7 user staff 224 Sep 4 16:12 app
-rw-r--r-- 1 user staff 0 Oct 24 14:56 application.txt
-rwxrwxrwx 1 user staff 1686 Sep 4 16:12 artisan
drwxrwxrwx 4 user staff 128 Sep 4 16:12 bootstrap
-rwxrwxrwx 1 user staff 1527 Sep 4 16:12 composer.json
-rwxrwxrwx 1 user staff 148959 Oct 24 00:35 composer.lock
drwxrwxrwx 15 user staff 480 Sep 4 16:12 config
drwxrwxrwx 6 user staff 192 Sep 4 16:12 database
-rwxrwxrwx 1 user staff 1022 Sep 4 16:12 package.json
-rwxrwxrwx 1 user staff 1134 Sep 4 16:12 phpunit.xml
drwxrwxrwx 10 user staff 320 Sep 4 16:12 public
-rwxrwxrwx 1 user staff 3924 Sep 4 16:12 readme.md
drwxrwxrwx 6 user staff 192 Sep 4 16:12 resources
drwxrwxrwx 6 user staff 192 Sep 4 16:12 routes
-rwxrwxrwx 1 user staff 563 Sep 4 16:12 server.php
drwxrwxrwx 6 user staff 192 Oct 24 01:20 storage
drwxrwxrwx 6 user staff 192 Sep 4 16:12 tests
drwxrwxrwx 40 user staff 1280 Oct 24 00:41 vendor
-rwxrwxrwx 1 user staff 537 Sep 4 16:12 webpack.mix.js

ls -la 应用程序/存储

drwxrwxrwx   6 user  staff  192 Oct 24 01:20 .
drwxrwxrwx 27 user staff 864 Oct 24 15:44 ..
drwxrwxrwx 4 user staff 128 Sep 4 16:12 app
drwxrwxrwx 7 user staff 224 Sep 4 16:12 framework
drwxrwxrwx 2 user staff 64 Oct 24 01:20 logs
drwxrwxrwx 3 user staff 96 Oct 24 00:43 php

最佳答案

试试这个命令,

php artisan optimize:clear

如果 php artisan 报错则执行,

composer update

关于php - Laravel 在 "storage/logs"处没有现有目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52958681/

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