gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 10:47:18 27 4
gpt4 key购买 nike

我正在使用 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 对源文件夹和目标文件夹的权限

关于php rename() 函数权限被拒绝,即使文件夹权限是 775,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32577823/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com