上傳檔案失敗:A problem was encountered while attempting to move the uploaded file to the final destination.
// 錯誤:權限字串 '777' 被當作八進位 0777 以外的值處理 if (!is_dir($cache_path)) mkdir($cache_path, '777');
// 正確:八進位數字 0777(注意前導 0) if (!is_dir($cache_path)) mkdir($cache_path, 0777);
0777、0755)'777' 會被轉為十進位 777,對應八進位 1411,權限錯誤x 執行權限才能進入// 遞迴建立 + 明確權限 + 錯誤檢查
if (!is_dir($cache_path)) {
if (!mkdir($cache_path, 0755, true)) {
log_message('error', "無法建立目錄: $cache_path");
}
}