How to Install LAMP Stack Server on Windows Subsystem Linux (WSL Windows 10)

Syed Sharizal
1 min readJan 2, 2018

--

Now with windows 10 (anniversary edition), you can install the windows subsystem for Linux, which provides an environment for a Linux userspace to operate.

Windows Subsystem Linux

Requirements:

windows 10 (64 bit) anniversary edition or laterinstall windows subsystem linux

Guide to installing WSL -> Link

Installing a LAMP stack:

Step One: Update System

Update the system:

sudo apt-get update && sudo apt-get upgrade

Step Two: Start bash.exe type:

sudo apt-get install lamp-server^

remember the caret (^) at the end of the command.

add these 2 lines in /etc/apache2/apache2.conf :

Servername localhostAcceptFilter http none

then you can start apache :

/etc/init.d/apache2 start

Step Three: Test Web Server, PHP and MySQL

Test Apache: Open Web Browser and type this URL:

http://127.0.0.1 or http://localhost

Test PHP: Create below file (info.php) and place it in /var/www/html

<?php
phpinfo();
?>

Open Web Browser and type this URL:

http://127.0.0.1/info.php or http://localhost/info.php

Test MySQL: Type below command in bash prompt

service mysql startmysql -uroot -ppassword

--

--

Syed Sharizal
Syed Sharizal

Written by Syed Sharizal

Delivering on 5G and Digital Transformation

Responses (10)