try to change the owner first the owner is you and the group server group and make it recursively then change the permission in root file also recursively to be 775 commands : sudo chown -R $user:$group . sudo chmod -R 775 . i hope this solve your problem
Jan 18, 2025
5
Level 5
Why I got error Permission denied in lavavel sail app and cannot fix them?
I try to run laravel with docker sail and on sail command have output :
$ ./vendor/bin/sail up
[+] Running 7/0
✔ Container projectname-minio-1 Running 0.0s
✔ Container projectname-clickhouse-1 Created 0.0s
✔ Container projectname-mysql-1 Running 0.0s
✔ Container projectname-redis-1 Running 0.0s
✔ Container projectname-mailpit-1 Created 0.0s
✔ Container projectname-laravel.test-1 Running 0.0s
✔ Container projectname-nginx-1 Created 0.0s
Attaching to clickhouse-1, laravel.test-1, mailpit-1, minio-1, mysql-1, nginx-1, redis-1
nginx-1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx-1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx-1 | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
nginx-1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
nginx-1 | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
nginx-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
mailpit-1 | time="2025/01/18 08:32:02" level=info msg="[smtpd] starting on [::]:1025 (no encryption)"
mailpit-1 | time="2025/01/18 08:32:02" level=info msg="[http] starting on [::]:8025"
mailpit-1 | time="2025/01/18 08:32:02" level=info msg="[http] accessible via http://localhost:8025/"
nginx-1 | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf
nginx-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx-1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/99-generate-ssl-cert.sh
nginx-1 | 99-generate-ssl-cert.sh: Server certificate already exists, do nothing.
nginx-1 | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: using the "epoll" event method
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: nginx/1.27.3
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: OS: Linux 6.8.0-51-generic
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: start worker processes
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: start worker process 36
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: start worker process 37
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: start worker process 38
nginx-1 | 2025/01/18 08:32:02 [notice] 1#1: start worker process 39
clickhouse-1 | ClickHouse Database directory appears to contain a database; Skipping initialization
clickhouse-1 | Processing configuration file '/etc/clickhouse-server/config.xml'.
clickhouse-1 | Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
clickhouse-1 | Logging trace to /var/log/clickhouse-server/clickhouse-server.log
clickhouse-1 | Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
laravel.test-1 | 2025-01-18 08:32:09 ................................................... ~ 0s
laravel.test-1 | 2025-01-18 08:32:09 ................................................... ~ 1s
laravel.test-1 | 2025-01-18 08:32:10 .................................................. ~ 16s
laravel.test-1 | 2025-01-18 08:32:26 ................................................... ~ 3s
laravel.test-1 | 2025-01-18 08:32:29 .................................................. ~ 47s
laravel.test-1 | 2025-01-18 08:33:15 ................................................... ~ 2s
laravel.test-1 | 2025-01-18 08:33:17 ................................................. ~ 109s
laravel.test-1 | 2025-01-18 08:36:46 ................................................... ~ 0s
laravel.test-1 | 2025-01-18 08:37:21 ................................................... ~ 0s
laravel.test-1 | 2025-01-18 08:36:46 .................................................. ~ 58s
laravel.test-1 | 2025-01-18 08:37:44 .................................................. ~ 25s
laravel.test-1 | 2025-01-18 08:38:08 .................................................. ~ 63s
laravel.test-1 | 2025-01-18 08:40:09 ................................................... ~ 1s
But running url
http://0.0.0.0/
I got error :
There is no existing directory at "/projectpath/storage/logs" and it could not be created: Permission denied
In the browser.
I run in the root of the app :
sudo chmod -R 775 storage
sudo chmod -R ugo+rw storage
chmod -R 775 bootstrap/cache
But Still got the same error?
Googling for decision I check firewall options:
# sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
80,443/tcp (Apache Full) ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
80,443/tcp (Apache Full (v6)) ALLOW IN Anywhere (v6)
In my app:
"php": "^8.1",
"laravel/framework": "^10.0",
"laravel/sail": "^1.0",
I do not see why this error and how to fix it ?
Please or to participate in this conversation.