Manual WAMP stack for PHP development on Windows

Published:

For future reference...

PHP

  1. Download an x64 Thread Safe zip from php.net.
  2. Read the note about Visual C++ Redistributable in the sidebar of that download page, and install the one required for your version.
  3. Unzip somewhere and add to PATH.
  4. Pick a php.ini and adjust as necessary (enabled extensions, etc.).
  5. In particular, make sure the following is not commented out:
extension_dir = "ext"
  1. Check that it works:
php --version

Composer

  1. Download the Windows Installer from getcomposer.org.
  2. Run the installer.
  3. Check that it works:
composer --version

Apache

  1. Download the Apache Win64 zip from apachelounge.com.
  2. Read the note about Visual C++ Redistributable above the downloads on that download page, and install the required one.
  3. Unzip somewhere and adjust httpd.conf as necessary (paths, enabled modules, etc.).
  4. Install as service:
httpd.exe -k install
  1. Start the service.
  2. Check that it works:
start http://localhost

Apache with PHP

  1. Add the following to httpd.conf.
LoadModule php7_module C:/path/to/php/php7apache2_4.dll
<IfModule php7_module>
    DirectoryIndex index.html index.php
    AddHandler application/x-httpd-php .php
    PHPIniDir "C:/path/to/php"
</IfModule>
  1. Add an index.php to your DocumentRoot for testing, e.g.:
<?php phpinfo();
  1. Restart the Apache service.
  2. Check that it works:
start http://localhost

MariaDB

  1. Download a Windows x86_64 MSI Package via mariadb.org.
  2. Run the installer.
  3. Optionally add some of the following to my.ini under mysqld section:
; Only listen on localhost
bind-address=127.0.0.1

; Enable logging of queries
; (probably bad in production, but very helpful for development debugging)
general-log=1
general-log-file=queries.log
log-output=file
  1. Restart the service, if you changed anything in the ini.
  2. Check that it works by connecting with HeidiSQL or any other SQL client.