LAMP Stack on Windows

Reading Time: 2 minutes

Apache 2.4 Installation

Download Apache 2.4.16 win32 from Apache lounge – http://www.apachelounge.com/download/

Unzip entire content to C: and keep the folder name as given

Visual C++ Redistributable for Visual Studio 2015 package for Win32 and install it – https://www.microsoft.com/en-us/download/details.aspx?id=48145

Go to unzipped Apache folder –> conf edit httpd.conf and edit those lines;

Listen *:80

remove # from the line of  LoadModule rewrite_module modules/mod_rewrite.so

AllowOverride All

run Command line and go to Apache2.4 bin folder

then issue httpd -t

you will see Syntax OK message

then run the apache as service — but run the command line as admin!

httpd -k install

issue services.msc command in run and start apache server and go to localhost and see the landing page then voila if all works out1

PHP 5.6 Installation

Download Php 5.6 threadsafe win32, http://windows.php.net/download#php-5.6

make sure you install win32 thread safe package(includes apache php lib file) and x86 one not X64 otherwise it does fail for some reason! e.g – php-5.5.18-Win32-VC11-x86.zip

unzip everything in C folder php

then go to the folder and rename php.ini-development to php.ini

open php.ini file, find and alter those lines

this is important make sure you enter the correct path and its not backslashes!!

extension_dir = "C:/php/ext"

uncomment necessary extensions

extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

add php folder to your environment variable

041-installing-php

reopen apaches httpd conf file and add index.php

DirectoryIndex index.php index.html

and add the below line to the end of file

# PHP5 module
LoadModule php5_module "c:/php/php5apache2_4.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

then issue httpd -t to make sure syntax is correct

then start the service in services.msc

Mysql Installation

Download the mysql community edition + workbench bundle full stack — https://dev.mysql.com/downloads/windows/installer/5.6.html