因此,這裏的故事,即時通訊不是很有經驗的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的權限文件夾。如果它允許讀/寫 –