Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mthompson_cod's avatar

As others have said... 777 was a permission level added to *nix systems so people could argue over 777. Since according to others there is NEVER a reason to use them.

Okay... I know that is a little tongue in cheek... but this "hand slap" on EVERY SINGLE SITE (bgies having copied/pasted this to a NUMBER of forums) does get a little old.

The better question might be WHY CAN'T LARAVEL GET THEIR INSTALL PROCESS TO STOP INSTALLING THINGS WITH THE WRONG PERMISSIONS"

Seems like it might solve all these silly strings of confused people.

1 like
Čamo's avatar

I have a problem with deleting new created files. Laravel creates new files like session or cache with 644 permission. My deploy script can not delete this files although he is in www-data group. Have no idea how to fix it. Dont want to give jenkins user sudo privileges. Why Laravel give chmod 644 to his files?

realtebo's avatar

@Čamo Same problem here.

We ended using redis for cache.

I was here to ask you all if there is a 'file permission' setting to insert into cache.php config file at stores['file'][] level

My user is also member of www-data but cache file are created with a 644 permission, so shell user cannot delete the cache. I'm running only the php artisan opt:clear command using sudo. But it's a big problem for autodeploy.

riettotek's avatar

rwx configuration for owner, group and all other users of a given document. How to express it in numerical form:

r = read , w= write , x = execute

rwx rwx rwx = 777 (4+2+1 , 4+2+1 , 4+2+1)

kzsa's avatar

Log in to the sail container as root:

$ ./vendor/bin/sail  root-shell

In the container, assign storage recursively to the non-root sail:

$ chown -R sail:sail /var/www/html/storage

Before:

drwxr-xr-x 1 root root     32 Jun  4 13:28 storage

After:

drwxr-xr-x 1 sail sail     32 Jun  4 13:28 storage

Br.

Previous

Please or to participate in this conversation.