在这里疯狂,不知道为什么重命名(),copy()函数不起作用 [英] Going crazy here, can't figure out why rename(), copy() functions don't work

查看:101
本文介绍了在这里疯狂,不知道为什么重命名(),copy()函数不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我有的,

$name = "image.jpeg";
$to = "/var/www/vhosts/site.com/httpdocs/termination_files/personal_photos/original/".$name;    
$from = "/var/www/vhosts/site.com/httpdocs/public/userimages/original/".$name;

rename($from,$to); 

copy($from,$to);

这不行吗?目录权限设置为755,路径从ssh复制,因此它们是准确的。文件存在于从位置。

Shouldn't this work?! Directory permissions are set to 755, paths are copied from ssh, so they're accurate. Files exist in the from location.

推荐答案

我认为您可能使用的文件权限不正确。

I think you might be using incorrect file permissions.

'5'表示读取和执行。因此,如果网络服务器不是目的地的所有者,则无法将新文件写入磁盘。

'5' means 'read and execute'. So if the webserver isn't the owner of the destination, it won't be able to write the new file out to disk.

这篇关于在这里疯狂,不知道为什么重命名(),copy()函数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆