因此,这里的故事,即时通讯不是很有经验的PHP,最近搬到一个新的主机,我的网站在旧主机上工作正常,但在新的主机上有错误码。复制()函数/文件权限问题
错误消息说:
Warning: copy() [function.copy]: Unable to access http://i.imgur.com/USlH6p2.jpg in (directory)
继承人的地方说,有一个错误
function upload_image_remote($image, $name) {
$upload_dir = APP_PATH . '/image.uploads';
//check for directory rights
if(!is_writable($upload_dir)) {
echo do_error(_('Folder image.uploads is not writeable'));
exit;
}
//check if there's a directory for today uploads
$today = date("d-m-Y");
if(!is_dir($upload_dir .'/' . $today)) {
if(!mkdir($upload_dir .'/' . $today, 0777)) {
echo do_error(_(sprintf('Folder <strong>image.uploads/%s</strong> could not be created. Please check permissions to be 0777.', $today)));
exit;
}
}
$upload_path = $upload_dir .'/' . $today;
(--> this is where) return copy($image, $upload_path .'/'. $name);
}
我认为它可能是一个权限问题,因为它的工作完美码(老主机)000webhost,任何人有什么想法可能是错误的代码?
感谢
是'$ image'你的src文件路径吗?检查你的src的权限文件夹。如果它允许读/写 –