Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php wont delete 775 dir chmod

OK help me understand this.

I have 2 users in my linux system that are BOTH part of "web-users" group.

one is www-data used by the webserver and php-cgi one is my ftp-user

when I upload files via ftp they are set to 775 for dirs and 664 for files, when I run a script on the server (so same group like the ftp user) to delete that directory and files inside: unlink for files works ok but the command rmdir doesnt work returning permission denied!? And yes the directory is deleted after is emptied.

why is that 775 means that the group's user can delete it just like 664 for files.

Thanks!

like image 879
Sandro Antonucci Avatar asked Jun 11 '26 10:06

Sandro Antonucci


1 Answers

You might check the permissions of the parent that contains the directory you're trying to delete.

I was deleting some script-generated directories earlier this week and even with their permissions set to 777, I was still getting "permission denied" until I gave myself Write access to the parent directory.

like image 195
drudge Avatar answered Jun 13 '26 23:06

drudge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!