As of this writing, the current version of Apache is 2.2.9 and PHP is 5.2.6.

  1. Download the Apache Windows MSI Installer from Apache.org
  2. Download the PHP Windows Zip Package from PHP.net.

Depending on your settings, Windows Vista's User Account Control (UAC) may cause permission issues in your Drupal installation. This guide assumes that you can run as administrator on your Windows Vista machine.

The first step to getting Drupal running on your Windows machine is to set up the Apache web server by running the Apache MSI installer. The following steps will walk you through the installation:

  1. Click the Start orb
  2. Search for Command Prompt
  3. Right Click on the icon and Run as Administrator
  4. Navigate to where you have the Apache MSI saved at (e.g. cd c:\Users\username\Desktop if the file is saved to your Desktop)
  5. Run the Apache MSI Installer with the command: msiexec /i apache*.msi
    • (* The full filename should be put in here. However, you can hit tab on the keyboard after typing apache and the command prompt will autocomplete the filename for your)
  6. Select Next
  7. Select "I accept the terms in the license agreement"
  8. Select Next
  9. Fill in your server information if it is known. A typical setup will use the "for All Users, on Port 80, as a Service" option. If this is being setup as a test machine, you may use localhost as the Network Domain and the Server Name. Select Next.
  10. Select the Typical Setup
  11. Choose a Destination Folder for the Installer to place the program files into. Note: the default Apache Installer location is C:\Program Files\Apache Software Foundation\Apache2.2. Because of the spaces in the directory name, using this folder may cause cgi and php scripts to not find the paths correctly. Also, Windows Vista's UAC will manage the permissions of all the files/folders in the htdocs directory. To avoid potential permission issues, it is easier to install Apache to its own directory outside of the standard Program Files directory (e.g. c:\Apache).
  12. Select Finish
  13. If a Firewall is enabled, make sure that port 80 and port 8080 are unblocked and open.
  14. To test if the Apache server is running, open up http:\\localhost in a browser. A plain black and white page should come up that reads "It Works!"

Configuring Apache:

  1. Using a text editor such as Notepad, open the httpd.conf file. This file is found in the /conf sub-directory under the directory that was set up during installation. Alternatively, a shortcut may be found in the start menu under the Apache HTTP Server folder.
  2. Note: Windows based systems uses backslashes \ and Unix based systems use slashes / for paths. In the Apache configuration files, slashes / should be used in path names.
  3. Change the ServerRoot path to point to the base path of your Apache installation (e.g. C:/Apache) on line 35 of the default httpd.conf file. In the default httpd.conf file, if the defaults were used during the installation, it would point to "C:/Program Files/Apache Software Foundation/Apache2.2".
    Note: Wrapping the path name in quotes will escape out any spaces that are used.
  4. Change the DocumentRoot to point to the location of the root document folder (e.g. C:/Apache/htdocs). This can be found on line 177
  5. Change the Directory path to the location of your htdocs directory (e.g. c:/Apache/htdocs). This is found on line 204 of the default httpd.conf file.
  6. If you are going to need to use CGI files, change the Directory path on line 340 to the location of your CGI directory
  7. To save a some steps for the PHP setup, you can add index.php to the DirectoryIndex to have Apache run index.php as a default page in a directory. This is found on line 239 of the default httpd.conf file.
  8. Append the following lines to the end of the httpd.conf file:
           LoadModule php5_module "c:/php/php5apache2_2.dll"
           AddType application/x-httpd-php .php
           PHPIniDir "C:/php"
  9. Save and Close

Installing PHP:

  1. Unzip the PHP files to C:\php
  2. Copy c:\php\php-ini-recommended.ini and rename itc:\php\php.ini
  3. Uncomment the Windows include_path on line 522
    Note: In the PHP.ini file, semicolons are used to denote that something is commented out. To uncomment a line, simply remove the semicolon.
  4. Update the doc_root to match the one that was set up in the httpd.conf file on line 529.
    Note: The PHP INI files uses the Windows style backslash \ for path names.
  5. Update the extension_dir on line 536 to "C:\php\ext"
  6. Uncomment php_gd2.dll extension on line 661.
  7. Uncomment php_mbstring.dll extension on line 668.
  8. Uncomment mysql.dll extension on line 675.
  9. Update the sessions.save_path to the Windows temporary files directory (e.g. C:\Temp).
  10. The PHP directory needs to be added to the Path Environment Variables
    1. Open the Control Panel
    2. Open System & Maintenance > System > Advanced System Settings > Environment Variables
    3. Append ;C:\php to the end of the Path System Variables list and Click OK.
  11. Restart Apache
  12. To test PHP on Apache, go to the root directory (e.g. C:\Apache#92;htdocs) and create a new php file in it. In this file, use PHP's phpinfo() function to see the server's configuration information. For example:
    <html>
    <body>
    <?php phpinfo() ?>
    </body>
    </html>

    Open this file in a browser (i.e. http:\\localhost\filename.php).

Alternative Options: Bundled Packages