How to Install and Configure Laravel 10 on Windows 11

Amin
mabttech
Published in
5 min readDec 28, 2023

Introduction

Follow this guide to set up Laravel 10 on Windows 11, which includes installation of software like Node.js, Composer, XAMPP, and configuring an IDE like PhpStorm or Visual Studio Code.

Prerequisites

  • Windows 11 operating system.
  • Basic understanding of HTML, core PHP, and advanced PHP.
  • Familiarity with command-line operations.
Laravel 10 installation on windows 10 / 11

— — — — — — — — — — — — — — — — — — — — —

Step-by-Step Installation

Step 1: Install Required Software

( For this setup, we will proceed with standard installations, focusing on the latest versions of each software. Specifically, we will be using PHP version 8.2.x. It’s important to ensure that all software is up-to-date to avoid compatibility issues. )

  1. Node.js: Download and install from Node.js website.
  2. Composer: Download and install from Composer website.
  3. XAMPP: Download and install from XAMPP website.
  4. 7zip: Download and install from 7zip website.
  5. Hyper Terminal: Download and install from Hyper.is.
  6. IDE for Development: Choose between Visual Studio Code and PhpStorm.

Step 2: Set Environment Variables

  1. On your Windows 11, search for env, then select "Edit the system environment variables".
  2. In the System Properties window, click on “Environment Variables”.
  3. Under “System Variables”, find and select “Path”, then click “Edit”.
  4. Add the path to your PHP installation (e.g., C:\wamp64\bin\php\php8.2.0) and Composer if they are not already present.
  5. Click “OK” to save your changes.
1
2
3
4

Step 3: Verify Installation

  1. Open Hyper Terminal.
  2. Check PHP version: Type php -v.
PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15) (ZTS Visual C++ 2019 x64)
php --version

3. Check Node.js version: Type node --version.

v18.18.0
node --version

4. Check Composer version: Type composer -v.

Composer version 2.6.6 2023-12-08 18:32:26
composer -v

Step 4: Install Laravel

  1. In Hyper / windows Terminal, run composer create-project laravel/laravel your-project-name.
  2. Navigate to the project directory: cd your-project-name.
  3. Start Laravel: php artisan serve.
  4. Optionally, specify a different port using php artisan serve --port=8001.
If you get this issue, it’s because that 7zip ain’t installed yet! you need to make sure that 7zip is installed before running the command !
> composer create-project laravel/laravel your-project-name
> php artisan serve

Step 5: Setup Database

  1. Start XAMPP and ensure MySQL is running.
  2. Open http://localhost/phpmyadmin in your browser and create a new database named simple_project.
  3. In your project directory, open the .env file and update DB_DATABASE with the name of the database you created.
  4. Open config/database.php and ensure the MySQL engine is set to InnoDB.

Step 6: Serve Your Laravel Application

  1. Use the command php artisan serve to start your Laravel application.
  2. Access the application by navigating to http://127.0.0.1:8000 in your browser.
http://127.0.0.1:8000/
http://127.0.0.1:8000/api

How to configure & add php artisan serve in phpstorm laravel 10

Sources :

Open Run/Debug configration , php script > select the artisan file path , (command Line / interpreter ) php version & your .env path.

php artisan serve --port=8020

Conclusion

Following this guide, you should have a fully functional Laravel 10 environment set up on Windows 11, complete with the necessary software and IDE. You can verify your versions of PHP, Node.js, and Composer with the provided commands to ensure compatibility.

— — —

PHPStorm Plugins to install for laravel:

— — —

Find out more :

Laravel 10: Step by Step on How To Build a Simple Laravel Website From Ground Zero: https://medium.com/@opyzyle/laravel-10-step-by-step-on-how-to-build-a-simple-laravel-website-from-ground-zero-7cd1b88de06b

--

--