There are three tasks:
- Put the Drupal files on your server.
- Create a database for Drupal to use.
- Check the PHP register_globals setting on your server.
- Run the Drupal installation program, and tell Drupal about the database.
1. Put the Drupal files on your server
At the end of this task, all of the files that Drupal needs will be in a directory on your server. That directory will be accessible over the Web, at a URL you know.
Here are the steps in this task:
- Prepare a place on your server for the Drupal files.
- Download the latest version of Drupal from Drupal.Org, to your computer.
- Upload the files to the server, in the place you prepared.
1.a. Prepare a place on your server for the Drupal files
You need to put the Drupal files in a directory on your Web server. The directory should be one that Web browsers can get to.
When you buy hosting, your hosting company will create a directory for you, called your home directory. Usually, the files in your home directory are not accessible over the Web. This lets you keep private files on your server.
The hosting company will create a directory inside your home directory, usually called public_html. This directory is available to the Web. It is the root of your Web site.
Suppose your domain is drupalzombie.com. This maps to the directory public_html on your account. You create a file called cow.html, and put it in public_html. So the path to the file is public_html/cow.html. The URL of the file http://drupalzombie.com/cow.html. Why? Because, in a sense, drupalzombie.com points to your public_html.
Suppose you create a directory in public_html, called emu. Then you create a directory in emu called wombat. You put the file eel.html inside wombat. So the file pathon your server is public_html/emu/wombat/eel.html. The URL would be http://drupalzombie.com/emu/wombat/eel.html.
If you want your site to be one single Drupal installation, then you don't need to do anything. public_html is ready. Just put your Drupal files there.
Let's not do that. Let's create a subdomain. This will make it easy to have several Drupal installations on the same account. It's also good for testing things out.
A subdomain is like yellow.drupalzombie.com. There's an extra name on the front of the URL. The name typically maps to a subdirectory like public_html/yellow.
Tell your server to create a subdomain, using your Web control panel. Here's how to create a subdomain in cPanel:

So, any files you upload into public_html/yellow will be accessible at http://yellow.drupalzombie.com.
1.b. Download the Drupal files to your computer
Here's what I see at http://drupal.org/download:

The big green button tells me that the latest stable release of Drupal is 7.10. Get whatever version the green button tells you to.
I click the green button, and see:

Drupal has hundreds of files. They are compressed into a single archive, to make downloading easier. Two archive formats are offered: tar.gz, and zip. I usually use the zip one; it's easier to work with on my Windows PC. I click the zip link, and that downloads the file drupal-7.10.zip to my computer.
Now I have the Drupal archive on my computer. I extract all the files from the archive. Here's how, in Windows 7:

Extract all... creates a directory called drupal-7.10. Inside that is another directory called drupal-7.10. Inside that are the Drupal files:

This directory nesting is a common source of errors for beginners. We'll see why in a moment.
1.c. Upload the files to the server, in the place you prepared.
Remember that I created the directory public_html/yellow. That's where the Drupal files go.
Start up favorite FTP client. Connect to your Web server, and navigate to the directory where your Drupal files will go.
Here's what I see:

mathieso is my user name, give to me by my hosting company. Your user name will be different. My home directory is /home/mathieso. /home/mathieso/public_html/yellow is the root of the subdomain yellow.drupalzombie.com. I created that earlier.
cgi-bin is not needed for Drupal. Delete it.
Now, in your FTP client, navigate to the files on your computer that you want to upload. This is where the nested directories cause trouble. You might have a screen like this:

It would be a mistake to drag drupal-7.10 into public_html/yellow. That would mean that the Drupal files would actually be in public_html/yellow/drupal-7.10 on the server. That's not what you want. You want the Drupal files in public_html/yellow. Open drupal-7.10 on your computer, so you get a screen like this:

Now drag all of the files to your server directory (hint: Ctrl+A often means "select all files"). You should end up with:

If you've done this right, you should have a file with the path public_html/yellow/index.php.
2. Create a database for Drupal to use
Drupal stores most of a site's content in a database. You need to create an empty database for Drupal to use.
I'm going to show you how to do it with cPanel. YMMV.
There are three steps:
- Create an empty database.
- Create a user account for the database.
- Give the user access to the database.
2.a. Create an empty database
On the cPanel home page, do this:

Now:

You'll see:

Notice the name of the database. You typed "yellow" (or whatever). But the name of the database is [your user name]_yellow. Why? Because other users may also have typed "yellow" into the database name field. How would the server know which one was which?
User names are unique. So adding the user name into the name of the database ensures that the server can tell the difference between your yellow database and everyone else's yellow database.
Record the name of the database. You'll need to tell Drupal about it later.
BTW, the database name need not be the same as the subdomain.
2.b. Create a user for the database
You need to create a new MySQL user account, and give it access to the database. MySQL user accounts have nothing to do with user accounts on your computer or server. MySQL user accounts are just used for MySQL.
On the same page where you created the database:

The user doesn't have to have the same name as the database. You can make up your own password, or have one generated for you.
Click Create User, and see:

Record this information. You'll need to tell Drupal about it later.
2.c. Give the user access to the database
On the same page where you created the user, find the Add User to Database section. Select the database and the user:

Click Add, and cPanel will ask you what privileges you want to to give the user. Grant them all:

Click Make Changes. You'll see:

So far, you've:
- Uploaded the Drupal files to your server
- Created a database for Drupal to use
3. Check the PHP register_globals setting on your server
Drupal is written in the programming language PHP. Early in PHP's history, a setting was added that seemed like a good idea at the time, but turned out to be a security problem. You need to make sure that setting is turned off, or Drupal will complain. The setting is called register_globals.
Go to your cPanel home page. Find the Software/Services section, and click on php.ini QuickConfig:

(If cPanel tells you that PHP QuickConfig is disabled, click the button cPanel gives you to enabled it.)
Find the register_globals setting, and turn it off:
![]()
Save the changes.
4. Run the Drupal installation program, and tell Drupal about the database
Almost done!
Point your browser at the root of your new Web site, e. g., http://yellow.drupalzombie.com. The Drupal install program will run. Choose the standard installation profile.

This will set up Drupal with the most common options. If you choose Minimal, you'll have more work to do.
Choose a language:

English is the default, but your can install dozens of other languages.
Tell Drupal about the database you created for it, using the information you saved earlier:

Drupal will activate a bunch of modules:

Then you'll fill in the site information form:

The SITE MAINTENANCE ACCOUNT is your super-admin-user-can-do-anything account. Don't forget the username or password. Or you won't be able to do much with your site. Click Save and continue.
Congratulations!
You have a Drupal installation. Have fun!

Add a comment