Installation Error - Directory Is Not Empty
Installing your preferred platform for your website is made easier using the application installers of your cPanel; however, there may be a time when you encounter an error while installing an application similar to the images below. For this example, we will use WordPress.
This error presents when there are files already present in the directory you're trying to install WordPress to and can be remedied by clearing the directory. This article covers how to achieve this for your primary domain, addon, and subdomains.
If you encounter an error when installing WordPress using Softaculous like the image above, you need to remove the first installation then re-install WordPress. Here is a video guide we created to assist you in this process.
To uninstall WordPress via Softaculous:
- Under the Softaculous homepage, click the Installations box on top.
- Locate the WordPress site you wish to uninstall.
On the list of options on the right-hand side of your website name, click the x Remove icon.
- Scroll down to the next page and click the Remove Installation button.
- A pop-up will appear, notifying you that this is an irreversible process. To proceed, click OK.
- Once the uninstallation is done, click Return to Overview.
You may now want to re-install WordPress. Please visit this guide for detailed instructions on how to install/re-install WordPress: How to Install WordPress With Softaculous.
If you wish to go back to your cPanel, click the cPanel icon located at the top-right menu.
QuickInstall is another application you will find in cPanel. Since this application is available to few users only, you can still utilize the QuickInstall as your installer though we strongly suggest using Softaculous. Please refer to this article for detailed instructions on how to use this application, QuickInstall.
When you're trying to install WordPress with the QuickInstall method, sometimes you'll get the error "Installation directory is not empty. Please install to an empty location".
To resolve the QuickInstall's installation directory issue, please follow the steps below.
- In the cPanel, navigate to the File Manager under the Files section.
Inside the File Manager, locate the domain's document root or directory.
For Primary Domain:
Click the folder public_html.
For Addon or Subdomains:
Click the addon or subdomain's document root or directory. To make sure you're in the correct document root, go to cPanel's Domains section, then select Addon Domains or Subdomains.
Locate your domain, then click on the document root link beside it.
In the upper right-hand corner, click on the Settings button.
- Check the box next to Show Hidden Files and click Save. This allows you to see all of the files in the folder.
- Select all of the files and folders in the directory by clicking the Select All button at the top of the window.
Then, click x Delete to move everything to the trash.
Now that the directory is clear, you should be able to install WordPress without getting any errors. If you're still getting this error, see the section below on checking the database.
Still Getting the Error?
Doing the process above should resolve the issue. However, if it does not, then the problem could be that the database or database user that the QuickInstall process is trying to create already exists, and it needs to be renamed or deleted.
During the QuickInstall process, it will create a database named cpaneluser_wrdp# and a corresponding database user with the same name. If either the database or user already exists without the matching user/database, then you may see the error.
This problem can be remedied by renaming or deleting the existing user or database. See our guide here on how to do that: How to Create or Delete a MySQL Database or User.