php 即使文件夹权限为 775,rename() 函数权限也被拒绝

php rename() function permission denied even folder permission is 775

我正在使用 php rename() 函数将文件从 /home/vsftpd/ 移动到 home/photo/upload。每个文件夹都在 www-data 组中,并且已经 chmod 可以按组写入。 但每次我 运行 我的脚本,它总是说:

 PHP Warning:  rename(/home/vsftpd/arie.heptabyte@gmail.com/bebas.jpg,/home/photo/upload/55f1185a129595b9bf8b4570/tmp/111DF153189852CDBC505B223ACED5F0F8B1416264E798E98B01C5112A75CD5C.jpg): Permission denied in /var/www/photoclient/cli/ftp.php on line 71

Warning: rename(/home/vsftpd/arie.heptabyte@gmail.com/bebas.jpg,/home/photo/upload/55f1185a129595b9bf8b4570/tmp/111DF153189852CDBC505B223ACED5F0F8B1416264E798E98B01C5112A75CD5C.jpg): Permission denied in /var/www/photoclient/cli/ftp.php on line 71

And here my code at line 71, other line just assign data into other section

   rename ('/home/vsftpd/arie.heptabyte@gmail.com/bebas.jpg', '/home/photo/upload/55f1185a129595b9bf8b4570/tmp/111DF153189852CDBC505B223ACED5F0F8B1416264E798E98B01C5112A75CD5C.jpg');

this is folder permission info

drwxrwxr-x  3 photo  www-data 4096 Sep  7 13:51 photo
drwxrwxr-x  4 vsftpd www-data 4096 Sep 14 10:57 vsftpd

我想知道,这里有什么问题吗?

other post that similar with this question just say to change the permission at parent folder. and i've done it.

谢谢

尝试授予 755644 对源文件夹和目标文件夹的权限