You are on page 1of 8

H2S Media SEARCH THE SITE 

 HOME  NEWS  REVIEWS  INTERVIEWS  HOW TO WINDOWS 11 TECH 

LINUX ALTERNATIVES

Home  How To  How to install Apache, MySQL, PHP & PhpmyAdmin on Windows 10 WSL

How to install Apache, MySQL, PHP


& PhpmyAdmin on Windows 10 WSL

H2S Media Team /
 Last Updated: April 19, 2020 /
HOW TO /
8 COMMENTS
If you are into web development, then I know you already familiar with LAMP
stack that contains Apache, MySQL, PHP and PhpMyAdmin (optional) on a
Linux platform. Yes, there are a couple of applications that provide LAMP in
single install package to test various kinds of web applications on Windows
10/8/7 such as XAMPP and WAMP. However, if you are on Windows 10 then
you don’t need them, you can get the native performance of Linux with
command line interface to download, install and manage LAMP packages.
And here in this tutorial, we let you know how to install MySQL, PHP and
phpMyAdmin on Windows 10 using Windows Subsystem for Linux.

The Windows Subsystem of Linux which is basically Linux compatibility layer


on Windows 10 to run various kind of minimal Linux distro images with
command line interface. Such as Debian, Ubuntu, Kali, Arch Linux,
OpenSUSE, CentOS and more… Some of them are officially available on the 
Windows 10 Microsoft Store such as Ubuntu. Here first, we will download
Windows 10 WSL Ubuntu and in further steps, we will understand how to set
up Apache, MySQL, PHP and phpMyAdmin (LAMP stack) on it. Thus, let’s
start the tutorial.
Contents [
show
]

Step 1: Enable Windows 10 WSL for


LAMP installation
Installing Windows Subsystem for Linux is not a big deal, we don’t have to
download some third-party packages at all. Just search for “Turns Windows
features on or off” in the search box of Windows 10. Then find an option
Windows subsystem for Linux, select and click the OK button.

On this topic, you can see our step by step article on how to activate Windows
10 WSL. ADVERTISEMENT

Step  2: Download WSL Linux Distro RECENT POSTS


The second thing we need is the Linux Distro on our WSL to install MySQL,
How to
PHP and phpMyAdmin. Although there are various Linux apps are available Download
Windows 1
on Microsoft Store but here we are installing the Ubuntu 18.04 WSL. So, in the 64-bit …
Windows 10 search box, type Microsoft Store and there search for Ubuntu.
When it appears, click on the Get button to install it.
Top 10 Fea
or benefits
running …
Step 3: Run Ubuntu 18.04 WSL
After installing, the Ubuntu will available in Windows 10 applications, click on it
to run. To start properly it needs to download some extra packages, thus it will
take some time, hence, be patient. Vivo paten
smartphon
a mini …

Virtual Cou
during the

pandemic:
Boon …

9 Best Onl
Android
Education
Apps of …
pp

ADVERTISEMENT

POPULAR POSTS

How to ins
XAMPP on
Windows 1

How to ins
and test
Windows 1


How to Mo
Step 4: Run system update command Windows 1
menu …
So, what we have now is exactly the Linux Ubuntu server in command line
interface, thus the command will also be the same to install any Linux
How to
How to
packages as we use in standard Ubuntu OS. Download
Windows 1
Although we have recently, installed the Ubuntu WSL distro, there will be a 64-bit …
possibility of updates, thus first run the system update command:

5 Ways to

sudo apt-get update
enable, ac
and use …
sudo apt-get upgrade

Step 5: Install Apache on WSL


ADVERTISEMENT
The first thing in a Linux based LAMP  stack is Linux OS itself which already
have setup above, now what we need is Apache web server. It is a light open
source web server to run different web apps and websites. To install it on LINUX
Windows 10 subsystem for Linux use the below command: 
Install Mongodb Compass GUI
Ubuntu 20.04 LTS Linux

sudo apt-get install apache2

sudo service apache2 start Install Graylog on Ubuntu 20.04


A log management software

How to install Thinkorswim on U


How to install Thinkorswim on U
20.04 LTS Linux

How to install Adobe Photoshop


Ubuntu 20.04 LTS Linux

Add User to Sudoers or Sudo G


AlmaLinux 8

ADVERTISEMENT

Step 4: Installing MySQL on Windows 10


WSL
To install MySQL on Ubuntu Windows 10 WSL, here is the command:


sudo apt-get install mysql-server mysql-client

sudo service mysql start

Create a root user to use with phpMyAdmin later



sudo mysql -u root


CREATE USER 'h2s'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'h2s'@'localhost';

FLUSH PRIVILEGES;

Note: Change the green colour text i.e Username and password with
whatever you want to assign.

Step 5: PHP installation in Ubuntu


Windows 10 WSL
Here we are installing PHP along with some important PHP extensions that 
you might need for your web projects.


sudo apt-get install php libapache2-mod-php php-mysql php-gd p

You might also like