---
title: "Sửa lỗi download failed khi update trong WordPress"
author: "Trung Hiếu"
date: "2014-07-31"
lastmod: "2022-06-19"
url: "https://wpcanban.com/wordpress/thu-thuat-wordpress/sua-loi-download-failed-khi-update-trong-wordpress.html"
---

# Sửa lỗi download failed khi update trong WordPress

Hướng dẫn khắc phục lỗi download failed khi update trong WordPress.

![khac-phuc-loi-download-failed-khi-update-wordpress](https://wpcanban.com/wp-content/uploads/2014/07/wordpress-error-on-update.jpg)

Nếu bạn gặp lỗi download failed khi đang cố gắng cập nhật bộ cài WordPress, plugins hoặc themes thì nguyên nhân có thể là do các thư mục tạm thời (temporary directory) được [WordPress](https://wpcanban.com/category/wordpress) sử dụng để download dữ liệu. Bạn có thể dễ dàng khắc phục lỗi này bằng cách xác định một WP_TEMP_DIR trong tập tin wp-config.php của blog/ website theo hướng dẫn sau đây.

Tham khảo thêm:

- [Sửa lỗi yêu cầu đăng nhập tài khoản FTP trong WordPress](https://wpcanban.com/wordpress/thu-thuat-wordpress/sua-loi-yeu-cau-dang-nhap-tai-khoan-ftp-trong-wordpress.html)
- [Khắc phục lỗi number_format_thousands_sep trong WordPress](https://wpcanban.com/wordpress/thu-thuat-wordpress/loi-number-format-thousands-sep-trong-wordpress.html)

## Lỗi download failed trong WordPress

Lỗi này thường xuất hiện khi bạn cập nhật WordPress, theme và cả plugin:

### Cập nhật WordPress thất bại

![wordpress-core-update-failed](https://wpcanban.com/wp-content/uploads/2014/07/wordpress-update-core-failed.png)

Nếu bạn đang cố gắng để nâng cấp bộ cài WordPress, bạn có thể gặp phải lỗi này:

```
Download failed.: Destination directory for file streaming does not exist or is not writable.
Installation Failed
```

### Cập nhật plugin hoặc theme thất bại

![wordpress-plugin-update-failed](https://wpcanban.com/wp-content/uploads/2014/07/wordpress-update-plugin-failed.png)

Nếu bạn đang cố gắng để cập nhật một WordPress plugin hoặc WordPress theme, bạn có thể sẽ gặp phải lỗi này, thay vì thông báo cập nhật thành công:

```
An error occured while updating (Plugin Name). Download failed. Destination directory for file streaming does not exist or is not writable.
```

## Khắc phục lỗi download failed khi update

Nếu gặp phải các lỗi kể trên, các bạn có thể làm theo các bước sau đây để giải quyết triệt để vấn đề.

1. Mở tập tin `wp-config.php` của bạn bằng Code Editor trong File Manager của cPanel/ DirectAdmin hoặc thông qua phần mềm FTP.

2. Tìm đoạn code sau ở phần đầu của tập tin:

```
* @package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'anotherd_wrd1');
```

3. Chèn đoạn code sau vào giữa đoạn code mà bạn vừa tìm được:

```
define('WP_TEMP_DIR', ABSPATH . 'wp-content/');
```

Và nó sẽ có dạng như thế này:

```
* @package WordPress
*/
define('WP_TEMP_DIR', ABSPATH . 'wp-content/');
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'anotherd_wrd1');
```

Lưu tập tin `wp-config.php` lại.

3. Hãy thử cập nhật WordPress một lần nữa. Nếu vấn đề trên vẫn chưa được khắc phục thì bạn nên kiểm tra lại permissions (CHMOD) của thư mục `/wp-content/` và đảm bảo nó được thiết lập ở quyền `755` để máy chủ có thể viết (writable) vào đó.

Bạn biết giải pháp khác tốt hơn để khắc phục lỗi download failed khi update WordPress? Hãy chia sẻ nó với chúng tôi trong khung bình luận bên dưới.

*Nếu bạn thích bài viết này, hãy theo dõi blog của tôi để thường xuyên cập nhật những bài viết hay nhất, mới nhất nhé. Cảm ơn rất nhiều. :)*
