Drupal is an open source Content management system (CMS) which can create rich content light weight web sites, you can visit www.drupal.org for information about drupal. GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE
This post targets the setup process of drupal on a Windows environment. Linux version of this post will be available soon.
Drupal is based on PHP,simply, it is a framework built using php, so in order to get it working you need to setup the environment suitable for PHP to work.
A- You need:
1- A web server (Apache is recommended for drupal however IIS is supported)
2- PHP itself
3- A data base server (Drupal supports both MYSQL 4.1+ and PostgreSql 7.3+)
# you can get latest version of apache (2.2) from Here
Apache is very light weight web server with very easy to install procedures.
# you can download PHP 5.2.3 HERE
It is recommended to download the Zip package and extract it manually to a folder usually C:\PHP
# Mysql is a very efficient,light weight and easy to use data base server, currently the lastest version is 5.0 and u can find it HERE also you will find a set of usefull tools for mysql such as GUI admin which is very good instead of mysql command line.
B- Setting up PHP to work with Apache:
you need to configure apache to identify .PHP files and to process them upon request, this can be done by:
1- open the directory named Conf in the installation directory of Apache
2- edit the text file named httpd and:
- look for DirectoryIndex and add index.php so it looks like this:
DirectoryIndex index.html index.html.var index.php - look for Addtype Section and add after the last sentence these lines
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
3- Now you need to load the php module for the apache to deal with, add these lines to the httpd file after the last LoadModule line:
LoadModule php5_module "C:/php/php5apache2_2.dll"
# of course directories here are relative.
What wont work:
1- Opening a .php file directly by left clicking it.
for apache to deal with a php file it has to be located in htdocs folder located in the apache installation directory and you can call a .php file by writing this in the address field of your web browser: http://localhost/"filename".php
C- Back to Drupal:
for druapl to start working you have to copy the folder named drupal-5.1 downloaded from drupal web site to the htdocs folder of apache, and type this in your web browser:
Ooops, a page may appear with the message saying that your web server does provide any data base supported by drupal. How can this happen? we already installed Mysql!!!
The answer is in PHP itself, at this point you may get confused about the reason of that error and you start going in circles and reinstalling apache and PHP as well as mysql, this is not the error...
the problem is simply that mysql module is not installed in php
D- Installing Mysql to work with PHP
1- make sure that u have the Dll files requried for mysql in the ext folder (php_mysql.dll)
2- make sure that php.ini file is present in the PHP folder, AND NOT PHP.INI.RECOMMENDED, rename this to php.ini.
3- php.ini and look for
extension_dir = ".\" and change it to
extension_dir = ".\ext"
4- look for the line extension=php_mysql.dll in the dynamic extensions sections and uncomment it by removing the ';' on its left.
As a basic test, many sites recommend writing a simple php script file the returns php info on your machine and running it to make sure that everything is fine, however, on some machines - including mine- after setting up the mysql module, this simple script does not work. To test, just point to this in your browser http://localhost/drupal-5.1
it is supposed now that you will see a database configuration page with the drupal logo above, this indicates that we are approaching the last step.
E- Drupal into action:
drupal needs a database with full access permissions to manipulate many aspects for building and managing sites, so we need to create a database in Mysql dedicated to Drupal, this can be done by writing some commands to the command line:
1- create a database in mysql for example named "drupaldb"
mysqladmin -u username -p create drupaldb
2- manage ur database
mysql -u username -p
3- Setting the permissions to the user u created and logged in with to mysql, as this user
name will be supplied to drupal to work with it
where user name is the drupal user name and password is this user's password.
now, supply the required information to the database configuration page of drupal, and hopefully every thing works now :).
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATETEMPORARY TABLES, LOCK TABLES ON drupaldb.* TO 'username@localhost' IDENTIFIED BY 'password';