Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Laravel on Windows

Install PHP and Composer, create a Laravel project and start the development server.

Windows Hosting2 min read8 steps13 screenshots

Requirements

  • PHP
  • Composer

Step 1: Install PHP

  1. Download the Windows build of PHP (a zip file, "Thread Safe" x64) from the PHP website.
    The PHP download page
  2. Extract it to a folder such as C:\php. Copy php.ini-development to php.ini. In php.ini, remove the ; before the extensions Laravel needs: extension=curl, extension=fileinfo, extension=mbstring, extension=openssl, extension=pdo_mysql and extension=zip.
  3. Add PHP to the PATH. Open the environment variables:
    The system variables
    The advanced system settings
  4. Select Path, click Edit and add C:\php.
    Adding PHP to the Path
    The PHP path variable
  5. Open a new Command Prompt and check:
php --version
The PHP version

Step 2: Install Composer

  1. Download Composer-Setup.exe from the Composer website.
    Downloading Composer
  2. Run it. Let it find your php.exe.
    The Composer settings
    The Composer setup
  3. Open a new Command Prompt and check with composer -V.

Step 3: Create a Laravel project

Go to the folder where you want to keep your projects and run:

composer create-project --prefer-dist laravel/laravel app-name
Creating a Laravel project

You can name a version, for example Laravel 11:

composer create-project laravel/laravel:^11.0 example-app
cd example-app

Step 4: Add a test route

Open routes/web.php and change it to:

<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return 'Hello, World!';
});
Editing the routes file

Step 5: Start the server

php artisan serve
Starting the development server

Open http://127.0.0.1:8000 in your browser. You see "Hello, World!".

The Laravel site on localhost

Why use Laravel on Windows

  • Easy local development without a Linux machine.
  • Fast start with Composer and Artisan.
  • A rich framework: routing, Eloquent ORM, Blade templates, queues and more.
  • You can later deploy the same project to a Linux server.

Quick recap

  • Install PHP and Composer.
  • composer create-project laravel/laravel app-name.
  • php artisan serve starts the site.