Installation failed could not create directory error in WordPress often triggers while users try to use a new version of WordPress or try to upgrade WordPress plugins and themes.
As a part of our Server Management Services, our Support Engineers helps to fix similar WordPress errors regularly.
Today, let us discuss the possible reasons for this error and how our Engineers tackle them.
What causes “Installation failed, could not create directory” error in WordPress
The “Installation failed, could not create directory” error message is a relatively standard error message. It often occurs when users try to use a new version of WordPress or try to upgrade WordPress plugins and themes.
Sometimes, users also receive this error when they try to install WordPress plugins and themes via WordPress dashboard or while attempting to upload files to the wp-content directory on our server.
In general, some of the common reasons that or Support Engineers have noticed for this error include:
- Error during installation: It indicates that the installation was not successful due to WordPress being unable to create a new directory. Hence, we get the error message “Installation failed, could not create directory.”. It essentially means that the user might have missed a crucial step during installation.
- WordPress permission: When WordPress creates a new website, the files are stored in folders or directories, which the webserver creates. These folders can only be accessed if we give WordPress permission to do so. Failure to do so might result in various error messages, such as the “Installation failed, could not create directory” or the “Failed to write to disk” error message.
- Disk quota: The error also happens if we exceed the quota limit of our server or if the directory we are trying to reach is already full.
How to fix “Installation failed, could not create directory” error in WordPress
The steps to be followed to fix the error depend on the real reason for this error. Let us now discuss some of the possible steps that our Support Engineers follow to fix this error:
Correct Directory permission
The first step is to ensure that the ownership of the WordPress directories is correct. Some cPanel based hosts require these directories to be under the ownership of the site user. Some require that the web server owns the directories where WordPress is installed.
To do this, our Engineers first use the code below to list all processes that are running,
ps aux | egrep '(apache|httpd)'
The next step is to allow access to WordPress directories:
# chown -R apache /var/www/html/
Update Folder Permissions With cPanel
The permissions for folder usage depend on the rights that each user has. For cPanel based servers, it can be corrected with the steps below:
- Login to cPanel account.
- Once logged in, search for “file manager” and open the first search option.
- To view files of our website, open “public.html”.
- Select all files under the root directory, right-click and open “file permissions.”
- Under the “permissions” button at the top of the page, click on the “change permissions” option.
- Then, a dialog box will open. Under the numeric value field, enter the number “755”. Next, check the “Recurse into subdirectories” checkbox and select the “Apply to directories only” option. Click on OK and wait for the FTP client to finish the process. It might take some time.
- The next step after the process is done, is to select all files under the root directory again and right-click, select “File permissions” and a dialog box will pop up.
- This time we will have to enter the number “644” under the numeric value field. Click on “Recurse into subdirectories.” and select “Apply to files only”.
- Confirm the changes.
- Clear browser cache and try to install a plugin or a theme. Now, the “Installation failed, could not create directory.” error message should not occur again and we should be able to install plugins and themes going forward.
Insufficient disk space in the server
Although it seems unlikely, the error “Installation failed, could not create directory.” might be caused by insufficient disk space in the server. It is a common issue if we are using shared hosting.
Here, Our Support Engineers ensure that we have enough space for the new files to be installed. Also, we should not store our backups in the same folder as our server, as we are risking our reserves with this method. Instead, use a cloud backup service like Dropbox.
[Need any further assistance in fixing WordPress errors? – We’re available 24*7]
In short, this error could happen due to a number of reasons like insufficient disk space, incorrect folder permission etc. Today, we saw how our Support Engineers tackle them.