How to Install Drupal and Fix Common Issues

Drupal was originally message board software which became open-source in 2001. Its name is taken from the Dutch word druppel which means “water droplet”. Similarly, Drupal is a web application framework which depends on object-oriented PHP programming. Like content management systems, Drupal includes RSS feeds, user registration and management, taxonomy, system administration, page layout customization, and menu management. It can be installed on any server that supports PHP and databases. It is relatively easy to use without any programming skills, though it is best known for the sophisticated API it offers programmers.

The easiest way to install Drupal by far is to use a software installer like Softaculous, but manual installation is also feasible and relatively easy to do. This guide will cover how to install Drupal via Softaculous, how to install it manually, and how to fix common issues with the installation.

Installing Drupal With Softaculous

First you will want to do a search for Drupal in the search bar of Softaculous to find it in the Softaculous database.

Next, click on the “Install Now” button to access the setup page.

Make sure the version you want to install is the latest version available.

For the protocol, select “https://” only if you have an SSL certificate installed on your website. If you don’t, select “http://”.

Next, select the domain you would like your Drupal website to be listed under.

If you would like your website to be in a sub directory of your domain (like http://yourwebsite.com/subdirectory), type the name you would like the sub directory to use next to “In Directory”.

The “CRON Job” menu allows you to specify when you would like your CRON jobs to run. If you don’t know what this is, leave it alone.

Under “Site Settings”, you can type in the name you would like your Drupal website to be called.

The “Admin Account” menu lets you set up an username and password for logging in to the Drupal administration panel, as well as an email address for Drupal’s administration panel to email you at to notify you of issues and updates. Make sure to make note of what your username and password are, as you will need these to administer and post to your Drupal website.

Under the “Advanced” menu, you can change the name of your database and database table prefixes if needed. If you aren’t hosting multiple Drupal websites on the same database, leave this alone.

You can also choose to disable receiving notification emails of updates to Drupal core.

You can change the location of your backups to the server, and also enable automated backups here. If your web hosting provider allows it, you can also change the number of backups Softaculous keeps at one time.

If you want installation details emailed to you, fill out the box below the “Install” button with your email address before you click “Install”. Otherwise, you can go ahead and click “Install”. After it is done installing, you will receive the URL of your Drupal website and the URL to visit to log in to the administration page of Drupal. Make sure you bookmark the URL of the administration page for Drupal so you don’t forget it.

You’re done! You now have Drupal installed to your server.

Installing Drupal Manually

The process for installing Drupal manually is slightly more complicated than installing it using a one click installer like Softaculous, but only slightly.

Start by downloading a copy of Drupal from its website at Drupal.org. Extract the contents to a folder on your desktop.

Next, upload the contents of the folder on your desktop via FTP to your server. You will need an FTP username and password, which usually are the same as the username and password you used to log in to CPanel. If this is not the case, or you don’t know your FTP username and password, consult your web hosting provider to find out what login credentials you need to use to access your server via FTP. You will also need an FTP client to login and upload the contents of the folder on your desktop. If you don’t have an FTP client, you can download one for free from CoreFTP.com.

Next, you will need to set up a MySQL database and database user for Drupal to use for storing data. In CPanel, this can be done by clicking the “MySQL Databases” icon.

Under “Create New Database”, type in a name for your new Drupal database, then click “Create Database”. Make note of the name of your database, as well, because you will need this information later for installing Drupal.

Scroll down to “MySQL Users > Add A New User”. Type an username and password for your Drupal database user, then click the “Create User” button. Make note of the username and password you set up here, as well, for the Drupal installation later.

Now you’re ready to install Drupal!

Go to your domain (http://yourwebsite.com), or if you uploaded the Drupal files to a directory, go to that directory (http://yourwebsite.com/directory).

Select the language you would like Drupal to use.

 

Next, select the installation profile you would like to use. It is best to select “Standard” if you are new to Drupal or an otherwise inexperienced user. This will install Drupal with its default set of plugins.

The next page is where you will need the information about the database and database user you created. Fill this information out using the database name, database username, and password you set up in MySQL earlier.

The next page will start the installation process for Drupal. Wait for it to finish.

When it has finished, it will ask you to create an username and password for administration and posting to Drupal. Fill out this information and make note of it since you will need it to login to Drupal. Finally, you will be met with your fresh Drupal site, where you can log in to start working on designing the site and posting content.

Common Issues in Drupal and How to Fix Them

Sometimes you may run into issues with a Drupal installation. Fortunately, many of these issues are relatively easy to fix. Here are some common issues you may run into with Drupal, and how to fix them:

Invalid Hostname

If you get the error “the provided host name is not valid for this server”, this is Drupal doing its job by protecting you against HTTP host header attacks. However, it can be annoying when you get this error and you’re obviously not attacking your website! Here’s how to fix it:

Log in to your server via FTP and find the Drupal “settings.php” file in “sites/default”. Open it.

Find this line:

Change it to the following, replacing “mysite” with your domain:

Overridden Configuration

Unfortunately, Drupal doesn’t warn you when you override configuration within the settings.php file. This can be annoying if you use both the settings.php file and the configuration UI simultaneously. You can fix this by doing one of the following, though:

Drupal.org has released a patch that fixes this. You can find it at https://www.drupal.org/node/2408549.

You can also see these changes in the Configuration Update Manager in the administration menu of Drupal.

Allowed Memory Exhausted

Sometimes you may get the error that the allowed memory limit has been exhausted. This simply means that Drupal needs more memory than what its settings allow. You can add an extra line to Drupal’s “sites/default/settings.php” file to fix this. Simply add the following line to the end of the file:

If this doesn’t work, you may need to increase your PHP memory limit. This can be done easily on shared hosting by copying the contents of your php.ini file (which can be found in CPanel > PHP) to a fresh php.ini file that you’ve created with a text editor, then adding the following line to it:

Next, save the file then upload it to your main Drupal directory. Find the section in CPanel that says “PHP processes”, and then click “kill processes”. This will force Apache server to restart and load up your configuration changes.

Failed to Connect to Database

This of course means that the Drupal installation can’t connect to your database. Make sure that your database name, username, and password are correct.

Cannot Create Directories

If Drupal can’t create the directories “files” or “private”, this is because it doesn’t have permission to write to the “sites/default” directory. The permissions on the “sites/default” directory should be 755, and the permissions on the “sites/default/settings” file should be 755. You can change these permissions using your FTP client (right click on the directories and files you want to change permissions to).

Cannot Write to Settings

Please follow the steps listed in “Cannot Create Directories”.