While managing a wordpress site recently, I kept getting the following error whenever I tried to switch to a new theme:
Unable to create directory.
That’s it. No path listed to indicate the directory it is trying to create, no detailed error message concerning permissions on the server, ftp account settings, folder permissions etc. Just ‘unable to create directory’.
So, I did what any red-blooded developer will do first whenever they don’t want to understand something but rather just get past it: Google it!
In this case though, the search results for strings like: ‘wp theme install could not create directory’ produced a lot of results that all pretty much read the same way:
- add so-and-so to your wp-config.php file.
- perform CHMOD command on the wp-content directory using 777.
- if it does not exist, create the wp-content/upgrade folder using an FTP client.
- if it does exist, delete/rename the upgrade folder and create a new one which gets the 777 permissions command applied to it.
- etc.
Unfortunately, none of this actually worked in my case. It turns out that my problem, that is, what caused me to lose any time at all, was insisting on getting the theme to ‘install’ by using the automatic FTP-based install procedure within the dashboard for the site. For all my attempts to produce the environmental conditions required for the auto-install script to just work, going that route was a waste of time. The only thing that did finally work, which is what I wish I had simply done from the start, and which will now be the way I ALWAYS install a new theme, is the following:
- Download the theme .ZIP file.
- Copy the unzipped folder (named after the theme) to the wp-content/themes directory.
- ‘Activate’ the theme from your wordpress dashboard (it’ll be visible as an installed theme if you simply copied the theme folder to the ‘themes’ directory).
This incredibly simple and quick method of installing a new theme for the wordpress site worked like a charm and was a one-minute matter. I wish I had known THAT before I googled it! Perhaps, you have landed here because you googled it, and this may help you avoid going down the permissions/configs route. At least, before you spend the better part of an hour pulling your hair out while one after another ‘solutions’ persists in NOT getting you past the issue, you might try ye-ole ‘manual’ route first and avoid the difficulty altogether. – Happy WordPress Managing!