Wednesday, November 19, 2008

Installing drupal 6.6 ,PHP ,Apache and MySql on Windows

In this tutorial ,I try to write exaclty the steps I passed through while installing Apache,MySql,PHP and druap for the first time on windows.


  1. Download Apache web server from http://httpd.apache.org/download.cgi
    ,for this tutorial I downloaded version 2.2.10 Win32 Binary without crypto (no mod_ssl)
    MSI Installer

  2. Run the installer , during installation I kept the default settings, the installation folder is
    "C:\Program Files\Apache Software Foundation\Apache2.2"

  3. For the Network Domain,Server Name and Administrator's Email Address I entered localhost,localhost and admin@localhost respectively

  4. Download and install MySql Community server from
    http://dev.mysql.com/downloads/

  5. Download and install MySql GUI Tools from
    http://dev.mysql.com/downloads/gui-tools/5.0.html
    , although these tools are
    not required but they make it easy to manage MySql Server

  6. Download PHP from http://www.php.net/downloads.php
    , for this tutorial I downloaded version 5.2.6 zip package

  7. Extract the PHP zip file into folder c:\php

  8. Add PHP folder to the system path

    • Right click on My Computer

    • Choose Advanced Tab

    • Click on Environment Variables button

    • From System variables , select Path

    • Click Edit

    • Add the folder where PHP is extracted (i.e. "c:\php") to the end of the Variable value

    • The Path Variable might look something like %SystemRoot%\system32;%SystemRoot%;C:\Program
      Files\MySQL\MySQL Server 5.0\bin;C:\php


  9. Restart your computer for the Path vaialbe to be reflected on the system

  10. Go to PHP installation folder ("c:\php") ,make a copy of php.ini-recommended and rename it to php.ini

  11. Edit php.ini

    • Set max_execution_time = 300 (line 303) , the default value is 30 but some drupal actions take longer time

    • Set display_errors = On (line 372), the default value is Off

    • Set display_startup_errors = On (line 377), the default value is Off

    • set extension_dir = ".\ext\" (line 536), this the folder where PHP extensions reside

    • Uncomment the following lines by removing the semicolon at the begining of each line ,to enable the corresponding extensions

      • ;extension=php_gd2.dll (line 661)

      • ;extension=php_mbstring.dll (line 668)

      • ;extension=php_mysql.dll (line 675)

      • ;extension=php_mysqli.dll (line 676)



  12. Edit httpd.conf found in "C:\Program Files\Apache Software Foundation\Apache2.2\conf"

    • To change your WWW root folder change DocumentRoot value (line 177) to your WWW root folder e.g. DocumentRoot "C:/wwwroot"

    • change <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"> (line 204) to <Directory "C:/wwwroot">

    • To Enable mod rewrite

      • Uncomment the following line #LoadModule rewrite_module modules/mod_rewrite.so (line 116) by removing the hash at the begning of the line

      • inside tag <Directory "C:/wwwroot"> (line 204) , change AllowOverride None (line 224) to AllowOverride All


    • To Enable PHP

      • Inside tag <IfModule dir_module> line (238) change DirectoryIndex index.html to DirectoryIndex index.php index.html so index.php will be regonized as a default file

      • at the end of the file add the following lines


        #Enable PHP 5.2.6

        LoadModule php5_module "C:/php/php5apache2_2.dll"

        AddType application/x-httpd-php .php

        # configure the path to php.ini

        PHPIniDir "C:/php"



  13. Using MySql query browser create a new schema called "drupalDB"

  14. Download Drupal 6.6 from Drupal Download

  15. extract the downloaded file to c:\wwwroot\drupal

  16. Go to drupal installation folder ("c:\wwwroot\drupal") ,make a copy of default.settings.php and rename it to settings.php

  17. If settings.php is readonly make it writeable

  18. Open your briwser and go the url http://localhost/drupal/ click make a new drupal installation and follow the wizard


That's it Done