Installing Drupal Locally on Windows Running a Apache, MySQL, PHP (WAMP) Web Server.
In this how-to we will create a website (www.example.com), set up a database, and install drupal to run the entire website. This tutorial should take about 10 minutes to do.
We'll assume that you already have a PHP & MySQL web server such as WampDeveloper Pro installed and ready.
First we'll need to create a website, composed of a DocumentRoot folder and a VirtualHost configuration. The DocumentRoot folder is a folder that contains the website files, and a VirtualHost configuration tells Apache about the existance of the website. If you already have a website ready, skip this step.
Using WampDeveloper Pro, go to the Websites Tab, Site Operations Section, and Click Add. Enter the following information and click Continue.
Domain Name: www.example.com Domain Aliases: example.com
This will automatically create and set up everything you need.
Go to drupal.org and download the latest version of Drupal 6. Once downloaded, open the drupal-6.xx.tar.gz file (it's a compressed file similar to a zip file) by either double clicking it, or by right-clicking it and selecting an "Open with..." application to use such as 7-Zip, WinZip, or WinRar.
You'll find a folder named "drupal-6.xx" inside. This folder contains all of the Drupal files needed to set up a CMS (Content Maagement System) for your website.
Using WampDeveloper Pro, go to the Websites Tab, and select your website in the list by single-clicking it. Then click the DocumentRoot button. This will open the DocumentRoot folder into which we will extract and place the inside contents of the downloaded file's "drupal-6.xx" folder.
First, we need to clear the website's DocumentRoot folder of any index.php, index.html, and .htaccess files, as Drupal provides its own index.php and .htaccess files. Select and delete these files.
Next, you can either extract the inside contents of the "drupal-6.xx" folder to the DocumentRoot folder directly, or simply select all files/folders inside it and copy-paste them into the opened website's DocumentRoot folder. Note that we are extracting the inside contents of the "drupal-6.xx" folder, and not the folder itself. This will allow us to access Drupal via URL http://www.example.com/, instead of URL http://www.example.com/drupal-6.xx/
Drupal uses a database to store all of its data (pages, post comments, some setting and information, etc). We'll create a new database for it, and also a database user that it will use to connect/login to MySQL (our database software). This can be done either via phpMyAdmin (a browser-based user interface to MySQL) or via MySQL's command shell (for advanced users). We'll use phpMyAdmin.
Make sure that the Apache2.2 & MySQL Services are running. Using WampDeveloper Pro, go to the System Tab, and click the phpMyAdmin button. This will open a new browser (IE, Firefox, Chrome, etc) tab or window and you'll see the login prompt for phpMyAdmin. Enter the following information (leave the password field blank, as it is (by default) not set for this user under WampDeveloper Pro):
User name: root Password:
Now that you are logged in, using phpMyAdmin, go to the Databases Tab, and create a new database named "drupal".
Then click the Privileges Tab, and select "Add a new User". Create a user named 'drupal' with password 'dp_pass' and host 'localhost' for that database. The option to "Grant all privileges on database 'drupal'" should already be selected for you (if not, select it).
Drupal reads its core database setting from a configuration file named settings.php, which is located in drupal's sites/default/ folder. We will first create a copy of this file from the included default file and then update it with the settings for our database and database user.
In drupal's sites/default/ folder, find file default.settings.php. Make a copy of this file by right-clicking it, selecting 'Copy', and then right-clicking somewhere in the folder and selecting 'Paste'. Rename the newly created "default.settings - Copy.php" file to "settings.php" by single-clicking on its name. Next, open this file by right-click it, and selecting 'Open With --> WordPad'. Don't use Notepad as it can't read the formating of this file and will display the text on a single line.
Locate the following lines:
$db_url = 'mysql://username:password@localhost/databasename'; $db_prefix = '';
Update the above lines to:
$db_url = 'mysqli://drupal:dp_pass@localhost/drupal'; $db_prefix = '';
Save changes to this file by selecting menu 'File --> Save'. Close this file.
Now that we have everything set up, we can finish the installation process by running the install.php file which will read our sites/default/settings.php database settings and populate the database with the proper data.
Using your browser, go to URL http://www.example.com/install.php and click "Install Drupal in English".
Enter: the site name, site e-mail address, the user name and password to use for your account (don't confuse this with the database user information), and your email address.
Once installation is finished, you will see a typical warning message about the installation process not being able to send an e-mail:
warning: mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smpt_port" setting in php.ini or use ini_set() in include\mail.inc.
Unable to send e-mail.
Ignore these warnings. They are harmless.
Click on the "your new site" link.
Enjoy your new website running on Drupal.