Skip to main content
All CollectionsWebsiteWordPress Management
How to fix "Could not create directory" Error
How to fix "Could not create directory" Error

Causes of "Could Not Create Directory" error in Wordpress and how to fix it

Updated over a week ago

The "Installation failed: Could not create directory" error typically happens when your WordPress website encounters issues creating a directory for a new plugin or theme, often due to misconfigurations or permission problems. It may happen during different processes, for example:

  • Installing new plugins or themes.

  • Updating existing plugins or themes.

  • Uploading media files.

Common causes of the "Could not create directory" error

  1. Incorrect file permissions: WordPress may not have the required permissions to create directories or upload files.

  2. Incorrect directory path: The directory path for uploads may be misconfigured in the WordPress settings.

  3. Disk space: The server may have run out of disk space, preventing WordPress from creating files and directories.

  4. PHP configuration: The PHP settings on your server may be limiting file uploads or directory creation.

How to fix the "Could not create directory" error in WordPress

  1. Verify and fix directory permissions: WordPress needs the correct read/write/execute permissions to manage files and directories. Here are the steps on how to fix it:

    1. Connect to Your Server via FTP or File Manager: Use an FTP client (such as FileZilla) or your hosting provider's file manager to access your website files.

    2. Go to the wp-content folder: Go to your WordPress installation folder and navigate to the wp-content directory.

    3. Set Correct Permissions on wp-content/uploads: This directory should be writable by WordPress. Set the permissions of the uploads folder to 755 (directories) and 644 (files). To adjust the permissions, right-click the uploads directory, then select Permissions:

      Next, set the numeric value to 755 for directories and 644 for files. Make sure all subdirectories inside the uploads directory have the same permissions. You can do this for all the directories where files need to be uploaded.

    4. Apply permissions recursively: If you are using FTP or a File Manager, you may also need to apply the correct permissions recursively. This will ensure that all files and subdirectories inside wp-content/uploads inherit the correct permissions.

      For more detils on permissions, refer to the following article : How to set access rights for files and folders.

  2. Check the uploads path in WordPress settings: Sometimes, WordPress may not be using the correct directory path for uploads, causing it to fail when creating new directories. Here are the steps to check and update the path:

    1. Log into your WordPress Dashboard.

    2. Go to Settings → Media.

    3. Check the Upload Path: Make sure the "Store uploads in this folder" option is set to wp-content/uploads (or a custom folder if necessary). Ensure that the path you enter is correct and that the folder is writable. If the upload path is incorrect, correct it and save the changes.
      ​Alternatively, you can also check your upload path from your database.

    4. Go to phpMyAdmin.

    5. Look for wp_options table (wp_ is the default prefix, your WordPress prefix may be different based on your installation).

    6. Find upload_path and change its value to the correct path:

  3. Increase PHP Limits: Sometimes, PHP settings on your server may restrict file uploads and directory creation. You can increase the PHP limits to allow WordPress to function properly. You can also adjust the limits by adding the following lines to your .htaccess file in the root directory:

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300

    Save the file and test your uploads again.

  4. Check disk space on your server: If your server is out of disk space, WordPress may not be able to create directories or upload files. To make sure of it, you need to check your server’s disk space usage. If you're nearing the disk quota, you’ll need to free up space. You can do it by deleting old backup, logs, or any other unnecessary files.

Conclusion

The "Could Not Create Directory" error in WordPress can be caused by several factors, including incorrect file permissions, misconfigured paths, and PHP limitations. By following the steps mentioned above, you should be able to identify and resolve the issue.

Make sure to:

  • Correct the file permissions for the uploads folder.

  • Verify the correct upload path in WordPress settings.

  • Increase PHP limits if necessary.

  • Ensure that your server has enough disk space.

Did this answer your question?