How to install Laravel on Windows

Riya Goel
3 min readJul 3, 2020

--

In this article, we will see how to install Laravel on your machine in Windows in just few simple steps.

Prerequisites:

  1. You must have PHP downloaded with a version greater than or equal to 5.3.2. If your PHP version is lower than this, do upgrade it.
  2. MySQL must also be installed on your machine

Installation via Installer

Installing Laravel via Installer is one of the easiest ways to get Laravel setup on your machine.

1. Download Composer

First and foremost, we need to download Composer . It is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. Download the Composer Windows installer. The installer will download composer for you and set up your PATH environment variable so you can simply call composer from any directory.

2. Test the Composer

Now it’s time to see whether the Composer has been properly installed. Close your current terminal. Test usage with a new Terminal.

This is important since the PATH only gets loaded when the terminal starts.

If you get this message being flashed on your Command Prompt as shown below, then you are good to go!

3. Downloading Laravel

Now it’s finally time to download Laravel on your machine. For downloading Laravel, type the following command on your Command Prompt

composer global require laravel/installer

4. Setting up the PATH

It is very important to make sure to place the ~/.composer/vendor/bin directory in your PATH so the Laravel executable is found when you run the laravel command in your terminal.

Installing via Installer gives you a benefit that it automatically sets the above mentioned directory to your PATH.

Just type PATH in the Command Prompt and notice that the paths have been already set.

5. Creating a new Laravel Project

First type dir followed by the complete path to list all the files and directories.

Create a new project by writing laravel new <project-name>. Doing this will automatically install all the required dependencies for your very first project.

6. Navigating to your project

After all of the dependencies have been installed, navigate to your project directory and type php artisan serve to set up a local PHP environment.

Browse through the given URL and if you see the Laravel landing page it means that Laravel has been successfully setup on your machine.

And this is how you can install Laravel on your machine in just a few minutes.

--

--