WebGee DocsDocs
WordPress

Fix "Unable to create directory"

WordPress cannot write to the uploads folder. How to correct file permissions, check the upload path, and rule out a full disk.

"Unable to create directory" appears when uploading media, updating a plugin or theme, or installing WordPress. WordPress cannot write where it needs to. Applies to all shared and reseller hosting.

There are three causes. Work through them in this order — permissions is the usual one, but a full disk produces the same message and no amount of permission-fixing will help.

1. Check disk space

If the account is at its disk quota, nothing can be written anywhere. Check Disk Usage in cPanel before changing anything else. See Monitor disk usage with cPanel.

2. Correct file permissions

Use cPanel's File Manager or an FTP client.

  1. Go to /wp-content/.
  2. Select the /uploads/ directory and open File Permissions (Change Permissions in File Manager).
  3. Set directories to 755.
  4. Tick Recurse into subdirectories and apply to directories only.
  5. Repeat for files, setting them to 644, applied to files only.

Directories and files need different values, which is why this is two passes. 755 on a directory means the owner can write and others can list it; 644 on a file means the owner can write and others can read it.

Never set anything to 777. It permits any process on the server to write to your files, and it is the permission malware looks for. It is also not a fix — if 755 does not work, ownership is wrong, and that needs support rather than a looser permission.

3. Check the upload path

A wrong path in WordPress makes it try to write somewhere that does not exist.

  1. In WordPress, go to SettingsMedia.
  2. Under Uploading Files, check Store uploads in this folder.
  3. It should be wp-content/uploads, or empty. If it holds an absolute path from another server — something beginning /home/olduser/ — that is the problem.
  4. Correct it and Save Changes.

This is common after a migration. If the field is not shown, the value is set in wp-config.php as UPLOADS and must be corrected there instead.

Verify

Upload a small image through MediaAdd New. If it succeeds, retry whatever failed originally.

If it still fails

The files are probably owned by the wrong user, which happens when files are extracted or restored as a different account. Ownership cannot be changed from cPanel — contact support with the affected path.

On this page