My user does not handle files generated in PHP

Asked

Viewed 37 times

-1

Hello, I’m having a problem with permissions I don’t understand why my user doesn’t have permissions on files created by "php"

Come on my user foo belongs to the following groups:

adm cdrom sudo dip www-data plugdev lpadmin sambashare laravel 

www-data groups

www-data : www-data laravel

He’s already in the www-data group

When php generates some file, for example a zipped folder, or even files it downloads from aws-S3 they come

wwww-data:www-data

These files my IDE for example can’t delete, if I try through the terminal I can’t either. I tried to change the project to foo:laravel but every new file he creates with www-data:www-data

When I Gero something by the Laravel for example a log or some cache comes

foo:laravel 

That there I can change normally

(Usable is a group I created testing to see if I solve this permission problem)

1 answer

1


You should put chmod 775 for the files created by www-data, so users of the same group can make changes. If you have root access on the server you can put the default value of the permission of the files created by www-data:

For debian, Ubuntu

echo "umask 002" >> /etc/apache2/envvars
service apache2 restart

For rhel, centos:

echo "umask 002" >> /etc/sysconfig/httpd
service httpd restart
  • is on my computer, I don’t own that file you mentioned no.

  • After its edition worked

Browser other questions tagged

You are not signed in. Login or sign up in order to post.