Last updated December 8, 2013. Created by gdeller on August 18, 2013.
Log in to edit this page.

Goal

Drupal 8.x install (dev environment) on a 2GB 32bit Asus-NL4 circa 2006, Windows 8.1 32bit Pro., with PHP 5.5.1, MySQL 5.6.13(VC11), Apache 2.4.6(VC11), and Drupal 8.x installed directly from zip files (no install exes or 3rd party AMP stack software). Drupal "install goal" is limited to creating a "first page".

The following simply a given record of steps and keystrokes used to achieve the goal. It is not a tutorial and has minimal explanation. It may apply or be useful to Windows 7, Vista and 64 bit installations. Insure all binaries (MySQL, VC11, Apache, PHP) downloaded are a bit-wise match.

Steps

  1. Decide where things will go
  2. Install and Configure MySQL
  3. Install and Configure PHP
  4. Install and Configure Apache
  5. Install and Configure Drupal

Logon to Windows using an administrator account. Additionally, all cmd.exe windows used in thes steps should be "run as adminstrator".

A text editor is required to edit ini and conf files. Notepad will do.

Terminology

The form $value_name$ is used to refer to an exact, case-sensitive value replacement of value_name. In some contexts, backslash ("\") may be converted to slash.

example: if php_home is located at "C:\WebStuff\php"

A text file line item to be edited:
extension_dir = "$php_home$/ext" would be entered:
extension_dir = "C:/WebStuff/php/ext"

A cmd.exe command:
CD /D "$php_home$\bin" would be entered:
CD /D "C:\WebStuff\php\bin"

Thus "$php_home$" would mean "C:\WebStuff\php" or "C:/WebStuff/php", depending on context.

Decide where things will go

Windows cmd.exe will be used for admin and setup. Large paths with spaces complicate admin and ".cmd" programming. Keep paths short and simple.

High-IO (data/logs) folders may be located off of boot/SSD drives.

Decide locations for:

  1. db_home : MySQL programs and files home folder (e.g. C:\MySQL)

  2. db_data : MySQL data files (e.g. D:\MyData) (not "$db_home$/data")

  3. php_home : PHP programs and files home folder (e.g. C:\PHP)

  4. ht_home : Apache programs and files home folder (e.g. c:\Apache24)

  5. drupal_home : home folder for Drupal 8 (e.g. D:\MyWebs\dru8)

Accept default or decide locations for:

  1. php_logs : PHP logs folder (e.g. D:\logs\php)

  2. php_save : PHP save folder (e.g. D:\system\php)

Decide names/values for:

  1. db_uid1 : a user id for data access by Drupal (e.g. "uid1") (do not use root)

  2. db_upw1 : a password associated to the @db_uid1@

  3. db_root_pw : a root password (make it a strong one)

Install and Configure MySQL

  1. DOWNLOAD "mysql-5.6.13-win32.zip" (or win64) from MySQL Community Server, and unzip contents to "$db_home$" folder.

  2. Copy "$db_home$/my-default.ini" to "$db_home$/my.ini" and edit "$db_home$/my.ini" as specified below.

    section [mysqld] : uncomment and set:
    basedir = "$db_home$/"
    datadir = "$db_data$/"
    character-set-server = utf8

    append the ini section [mysql] and set:
    [mysql]
    default-character-set = utf8

  3. Copy the contents of "$db_home$/data" to the "$db_data$" folder.

  4. This and all following steps are done within an "as admin" cmd.exe window.

    Any command using mysqld.exe or mysql.exe assumes a CD /D to the "$db_home$\bin" folder before running.

    Install MySQL as a service by entering these 2 lines:
    mysqld.exe --install

    (note: mysqld.exe is the the actual MySQL service, mysql.exe simply connects the user to the mysqld.exe)

    Start MySQL service (mysqld.exe) by entering:
    sc start MySQL

    Verify MySQL service is running by entering:
    sc query MySQL

    The response should indicate: MySQL STATE : 4 RUNNING
    (at this point, MySQL service will start whenever the machine is booted)

    The mysqld.exe error file is at "$db_data$\COMPUTERNAME.err" (where COMPUTERNAME is your computer's name)

  5. To cause MySQL service to NOT automatically start on reboot, enter:
    sc config MySQL start=demand

    Upon reboot, MySQL service will need a manual start (as in previous step).

    To cause MySQL service to automatically start upon reboot, enter:
    sc config MySQL start=auto

    To stop MySQL service, enter:
    sc stop MySQL

  6. With MySQL service running,
    (and assuming 1st time logon when root has no assigned password)
    create a password for MySQL root login by entering:
    mysql.exe -uroot

    at the "mysql>" prompt, enter (see note below):
    UPDATE mysql.user
    SET Password= PASSWORD('$db_root_pw$')
    WHERE User = 'root';

    (note: mysql.exe command entry is triggered by that final semicolon (";"),
    allowing entry over multiple lines before processing occurs)

    After the response, enter:
    FLUSH PRIVILEGES;
    then enter:
    exit;
    (this exits mysql.exe and returns to cmd.exe prompt)

  7. Login to mysql.exe as root by entering
    mysql.exe -uroot -p
    and enter db_root_pw when requested.

    At the "mysql>" prompt, create db_uid1 user id by entering:
    CREATE USER '$db_uid1$'@'localhost'
    IDENTIFIED BY '$db_upw1$';

    After the response, enter:
    GRANT ALL PRIVILEGES ON *.* TO '$db_uid1$'@'localhost'
    WITH GRANT OPTION;

    After the response, enter:
    exit;

    Avoid using root logon unless absolutly necessary.

  8. Login to mysql.exe as db_uid1 by entering:
    mysql.exe -u$db_uid1$ -p
    and enter the db_upw1 when requested.

    Create the db_web1 database by entering:
    CREATE DATABASE web1_data;

    When necessary, delete that database by entering:
    DROP DATABASE web1_data;

Install and Configure PHP

  1. If it's not installed on your machine, DOWNLOAD "Visual C++ Redistributable for Visual Studio 2012 Update 3" (vcredist_x86.exe or vcredist_x64.exe) - Save or move the chosen exe to the system drive(to insure it will install on that drive), and then run it to install it.

  2. DOWNLOAD"php-5.5.1-Win32-VC11-x86.zip" (or x64) (from "PHP For Windows") and unzip the contents to the "$php_home$" folder.

  3. Copy the "$php_home$\php.ini-development" file to "C:\Windows\php.ini" (i.e. the Windows folder).

  4. Edit the "php.ini" as specified below. Use forward slashes in pathnames. (note: remove the ini ";" comment line prefix to explicitly set values)

    Uncomment and/or set:
    extension_dir = "$php_home$/ext"
    allow_url_fopen = Off
    expose_php = Off
    max_execution_time = 300
    default_charset = "UTF-8"
    extension=php_curl.dll
    extension=php_imap.dll
    extension=php_gd2.dll
    extension=php_mbstring.dll
    extension=php_mysqli.dll
    extension=php_tidy.dll
    extension=php_pdo_mysql.dll
    extension=php_zip.dll

    optional settings:
    session.save_path = "$php_save$"
    error_log = "$php_logs$"

Install and Configure Apache

Prepare "hosts" file and Download Apache

  1. The windows "hosts" file is at "C:\Windows\System32\Drivers\etc\hosts" (i.e. the Windows folder). The "hosts" file has no extension, and must be explicitly opened within your text editor.

    Append the following lines (after the comments) of the "hosts" file to look like this:
    127.0.0.1  localhost
    127.0.0.1  localweb1

  2. DOWNLOAD "httpd-2.4.6-win32-VC11.zip" (or win64) from Apache Lounge, and unzip the contents to the ht_home folder.

Setup httpd.conf

Setup "$ht_home$\conf\httpd.conf" by editing as specified below. (note: "$ht_home$\original" contains copies of all "conf" files)

  1. change line:
    ServerRoot "c:/Apache24" to:
    ServerRoot "$ht_home$"

  2. uncomment the following lines:
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule vhost_alias_module modules/mod_vhost_alias.so

  3. After the last "LoadModule" line, add lines:
    LoadModule php5_module "$php_home$/php5apache2_4.dll"
    AddHandler application/x-httpd-php .php

  4. change:
    <Directory />
        AllowOverride none
        Require all denied
    </Directory>
    to read:
    <Directory />
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Deny from all
    </Directory>

  5. Insert the followng (after the above):
    <Directory "$drupal_home$">
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Deny from all
    </Directory>

  6. change:
    <IfModule dir_module/>
        DirectoryIndex index.html
    </IfModule>
    to read:
    <IfModule dir_module/>
        DirectoryIndex index.html index.php
    </IfModule>

  7. Change "DocumentRoot" by editing the lines:
    DocumentRoot "c:/Apache24/htdocs"
    <Directory "c:/Apache24/htdocs">
    to read:
    DocumentRoot "$ht_home$/htdocs"
    <Directory "$ht_home$/htdocs">

  8. Enable the following line by uncommenting it:
    Include conf/extra/httpd-vhosts.conf

Setup httpd-vhosts.conf

Setup "$ht_home$\conf\extra\httpd-vhosts.conf" by commenting out (or deleting) the example lines, and appending these lines:

<VirtualHost *:80>
    DocumentRoot "d:/@/Webs"
    ServerName localhost
    ErrorLog "logs/localhost.error.log"
    CustomLog "logs/localhost.access.log" common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "$drupal_home$"
    ServerName localweb1
    ErrorLog "logs/localweb1.error.log"
    CustomLog "logs/localweb1.access.log" common
</VirtualHost>

Install and Manage Apache

  1. Configure the PC firewall to allow "$ht_home$\bin\httpd.exe" to perform inbound TCP and UDP connections. In Windows Firewall, click on "Advanced settings" to do this.

    Any following commands using httpd.exe assumes CD /D to the "$ht_home$\bin" folder before running.

  2. Install and start Apache as a service by (in a cmd.exe window) entering:
    httpd.exe -k install
    httpd.exe -k start

    Verify MySQL service is running by entering:
    sc query Apache2.4
    The response should indicate "STATE : 4 RUNNING"

  3. Manage the Apache service using these cmd.exe commands:
    httpd.exe -k stop - stops service
    httpd.exe -k start - starts service
    sc config Apache2.4 start=demand - no auto start upon boot
    sc config Apache2.4 start=auto - auto starts upon boot

  4. With Apache service running, test it within a browser by entering "localhost" into the browser address bar.

    If it works, the page shown will say "It works!". Page "hanging" or "busy" or failure most likely indicates there is still a firewall configuration issue. After entering the inbound rules, we got it to work by turning off Windows Firewall, rebooting, testing, then turning the Firewall back on, and testing again.

  5. As setup, the DocumentRoot (in "$ht_home$\conf\httpd.conf") is pointing to "$ht_home$/htdocs". Change "DocumentRoot" (as specified above) to point to wherever you want. We point DocumentRoot to a folder containing our "static" webs and browse through our static webs at "localhost" via Apache server. We will use virtual "localweb1" (not "localhost") for Drupal development.

Verify Apache works with PHP

  1. Within the $drupal_home$ folder, create "phpinfo.php" file as follows:
    <?php
    phpinfo();
    ?>

  2. Within a browser, enter the address:
    http://localweb1/phpinfo.php
    The response should be a web page of detailed settings of PHP.
    (try with several browsers ... Firefox, Chrome, Opera, and IE)

  3. Once verified, for security reasons, delete the "phpinfo.php" file.
    (phpinfo() gives away delicious details of your server)

Install and Configure Drupal

  1. Delete the contents of the "$drupal_home$" folder.

  2. DOWNLOAD "drupal-8.0-alpha2.zip" (or newer) from Releases for Drupal Core, and unzip the contents to the "$drupal_home$" folder.

  3. Within a browser (suggest Firefox), enter the address:
    http://localweb1
    The Drupal setup screen should appear.

  4. Choose the language, then "Save and continue".

  5. Choose "Standard" or "Minimal", then Save and continue".

  6. Enter "Database name" as "web1_data";
    Enter the user name and password as $db_uid1$ and $db_upw1$ respectively ... and continue.

  7. "Site name" will be "localweb1"
    Enter a valid (but throwaway) "Site e-mail address".
    Enter Username: "admin"
    Enter a valid (but throwaway) "E-mail address".
    Enter a password for "admin"
    and confirm it
    ... and enter the rest of the fields.
    then "Save and continue".

  8. Upon page response, "Congratulations, you installed Drupal"
    Click on: "Visit your new site."

  9. Upon page "Welcome to localweb1"
    Click on: "Add new content"
    ... add your 1st page
    ... then view your 1st page.

Closing

We look forward to any feedback we get ... especially regarding: errors and corrections - easier/better ways - unset settings needed by a "fully featured" Drupal. The article will be updated accordingly.

You are welcome (at your own risk and endeavor) to use some .cmd files we created to simplify, manage, and document our setup. See the README.txt for setup and explanations. These are a convenience for the repeated tasks that occur during installation / development.

DOWNLOAD "drupal8.windows8.setup.zip" from our site.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.