0

I've followed this guide to set permissions for Laravel 9 running on WSL2 through docker. Everything works great, but whenever I run

php artisan config:cache

The /bootstrap/cache/config.php file does not get updated as you would expect.

ls -l returns the following after running config:cache:

-rw-r--r-- 1 www-data www-data 26933 Nov 16 08:10 config.php

The linked guide above sets the folder permissions to -rwxrwxr--, which then gets overrode by the config:cache command.

Is there any way to persist the permissions on this file without having to run chmod every single time I modify the .ENV or config files?

EDIT

After digging around some more, it looks like everything BUT the 'debug' variable is being updated in the bootstrap/cache/config.php file. Manually changing the debug value to true and re-running php artisan config:cache will revert debug back to false. I'm 100% sure my .ENV is set to true, as well as the backup in my config/app.php file. I'm running in the 'local' environment.

How do I get that debug value to persist?

Robert Gaum
  • 129
  • 1
  • 10

1 Answers1

0

Run

sudo chmod -R 777 /bootstrap/cache/config.php
sudo chmod -R 777 /bootstrap/cache

You can also run

sudo php artisan config:clear
sudo php artisan optimize:clear
  • Even though I don't like setting stuff to 777, running config:cache just resets it back to what I wrote in my question. The artisan commands didn't make a difference either. – Robert Gaum Nov 16 '22 at 13:39