Here I will show how to install drupal. I am using:
- Apache 2.2.6,
- PHP 5.2.5
- MySQL 5.0.25
- Windows XP
- web server root is c:\www
These instructions are valid for drupal 5.0 and above. I am installing drupal 5.5.
Download and extract drupal
Drupal can be downloaded from drupal.org. Once downloaded, extract the contents of the zip file.
Copy to web server root folder
The web server root is the address where a web server such as Apache look for files it is supposed to show on the Internet. If you do not know your web root, look into your httpd.conf file. It should be inside your Apache installation directory. Open this file and look for a line that looks like:
DocumentRoot "c:\www"
The web server root is c:\www. Create a folder called drupal at this address. Copy the contents of the extracted folder inside this folder. Once done, it should look as follows:
- c:\www\drupal\modules\
- c:\www\drupal\themes\
Prepare database for drupal
Create a database called drupal. Create a user called drupal_user. Grant full access on drupal to drupal_user from localhost. Replace xxxxxx on the third line with a password.
mysql> create database drupal;
mysql> create user drupal_user;
mysql> grant all on drupal.* TO 'drupal_user'@'localhost' IDENTIFIED BY 'xxxxxx';
mysql> flush privileges;
Run drupal
In your browser, type http://localhost/drupal/. Your should get a page asking you to type database information. Type in the information you just type in mysql command line.
Installation problems in drupal 5.5
If you get an error message at http://localhost/drupal/, edit your settings.php file. If you still get errors, check the configuration of your Apache. Refer to previous tutorials in this series for more information.
Edit settings.php file
Settings.php file contains installation configuration information. To edit settings.php file open it with notepad. It is located at:
c:\www\drupal\sites\default\settings.php
Change
$db_url = 'mysql://username:password@localhost/databasename';
to
$db_url = 'mysql://drupal_user:password@localhost/drupal';
Replace the password with the password you chose in the previous step.
Notices
Following is a common error message:
Notice: Trying to get property of non-object in C:\www\drupal5\includes\form.inc on line 325
Notice: Undefined variable: redirect in C:\www\drupal5\includes\form.inc on line 268
Notice: Undefined variable: base in C:\www\drupal5\includes\form.inc on line 465
Notice: Undefined index: #value in C:\www\drupal5\includes\form.inc on line 1045
Notice: Undefined index: #value in C:\www\drupal5\includes\form.inc on line 1045
Warning: Cannot modify header information - headers already sent by (output started at C:\www\drupal5\includes\form.inc:325) in C:\www\drupal\includes\common.inc on line 141
Notice: Undefined variable: no_module_preprocess in C:\www\drupal5\includes\common.inc on line 1472
Notice: Undefined variable: no_theme_preprocess in C:\www\drupal5\includes\common.inc on line 1493
These errors are due to php.ini configuration. PHP notices are harmless but they can sometimes generate "headers already sent" errors. These errors would hinder installation of drupal. The solution is to configure PHP to not display notices. Edit your php.ini and set error_reporting to as follows:
error_reporting = E_ALL & ~E_NOTICE
Restart Apache and you should be back in business.