Skip to content

Instantly share code, notes, and snippets.

@sutlxwhx
Last active May 28, 2024 14:43
Show Gist options
  • Save sutlxwhx/cb1c124d560c5a2d21fe94ca25aed1e1 to your computer and use it in GitHub Desktop.
Save sutlxwhx/cb1c124d560c5a2d21fe94ca25aed1e1 to your computer and use it in GitHub Desktop.
How to install LAMP stack on Windows 7 / 8 / 10

Introduction

This guide will help you install LAMP stack on your Windows machine. I made this to help people who want to use or try any of my projects on their local or remote computers under Windows OS.

Requirements

The fastest way to install LAMP stack on your Windows machine is to use WAMP. It comes with a lot of preinstalled modules for Apache and PHP-FPM along with Nginx and MySQL.

Configuration

After installation of WAMP you need to go to http://localhost using your browser and set up new virtual host. Click Add a Virtual Host under a Tools menu. That will take you to the next step:
localhost
We will use example.com as a test domain for you web application.
Type example.com and path to the folder which contains the project files in the relevent fields:
add virtual hosts
Then you will see this sucess notice:
success notice
If you didn't create example.com in the necessary folder you will see this failure notice:
failure notice
In the end you will need to restart your WAMP installation and you are good to go:
restart wamp

After that you will need to point your virtul hosts to your LAMP installation on the localhost in the C:\Windows\System32\drivers\etc\hosts file.
You will need to open C:\Windows\System32\drivers\etc\hosts with any text editor and append text like that to the end of the file:

127.0.0.1 example.com


Then you will need to git clone or download any of my repositories into this folder and unzip the archive. After you do that check that index.php file is inside your example.com folder or else the application might not work.

Future Reading

@artygrand
Copy link

Fresh info: You don't need to restart whole wamp and edit hosts
Right Click -> Tools -> Restart DNS will do it by itself

@greenozon
Copy link

What is the right way to address this issue in WAMP?

image

@TomaraRedfox
Copy link

If you install it on Windows, it's not LAMP. It's WAMP. Because LAMP stands for Linux+Apache+MySQL+PHP, and you are not installing or using Linux if you are installing this on Windows and you are not using WSL either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment