Manual WAMP stack for PHP development on Windows
Published:
For future reference...
PHP
- Download an x64 Thread Safe zip from php.net.
- Read the note about Visual C++ Redistributable in the sidebar of that download page, and install the one required for your version.
- Unzip somewhere and add to
PATH
. - Pick a
php.ini
and adjust as necessary (enabled extensions, etc.). - In particular, make sure the following is not commented out:
extension_dir = "ext"
- Check that it works:
php --version
Composer
- Download the Windows Installer from getcomposer.org.
- Run the installer.
- Check that it works:
composer --version
Apache
- Download the Apache Win64 zip from apachelounge.com.
- Read the note about Visual C++ Redistributable above the downloads on that download page, and install the required one.
- Unzip somewhere and adjust httpd.conf as necessary (paths, enabled modules, etc.).
- Install as service:
httpd.exe -k install
- Start the service.
- Check that it works:
start http://localhost
Apache with PHP
- 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>
- Add an index.php to your DocumentRoot for testing, e.g.:
<?php phpinfo();
- Restart the Apache service.
- Check that it works:
start http://localhost
MariaDB
- Download a Windows x86_64 MSI Package via mariadb.org.
- Run the installer.
- 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
- Restart the service, if you changed anything in the ini.
- Check that it works by connecting with HeidiSQL or any other SQL client.