How to Install and Configure Laravel 10 on Windows 11
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.
— — — — — — — — — — — — — — — — — — — — —
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. )
- Node.js: Download and install from Node.js website.
- Composer: Download and install from Composer website.
- XAMPP: Download and install from XAMPP website.
- 7zip: Download and install from 7zip website.
- Hyper Terminal: Download and install from Hyper.is.
- IDE for Development: Choose between Visual Studio Code and PhpStorm.
- Visual Studio Code: Download and install from VS Code website.
- PhpStorm: Download and install from JetBrains website.
Step 2: Set Environment Variables
- On your Windows 11, search for
env
, then select "Edit the system environment variables". - In the System Properties window, click on “Environment Variables”.
- Under “System Variables”, find and select “Path”, then click “Edit”.
- Add the path to your PHP installation (e.g.,
C:\wamp64\bin\php\php8.2.0
) and Composer if they are not already present. - Click “OK” to save your changes.
Step 3: Verify Installation
- Open Hyper Terminal.
- Check PHP version: Type
php -v
.
PHP 8.2.12 (cli) (built: Oct 24 2023 21:15:15) (ZTS Visual C++ 2019 x64)
3. Check Node.js version: Type node --version
.
v18.18.0
4. Check Composer version: Type composer -v
.
Composer version 2.6.6 2023-12-08 18:32:26
Step 4: Install Laravel
- In Hyper / windows Terminal, run
composer create-project laravel/laravel your-project-name
. - Navigate to the project directory:
cd your-project-name
. - Start Laravel:
php artisan serve
. - Optionally, specify a different port using
php artisan serve --port=8001
.
> composer create-project laravel/laravel your-project-name
> php artisan serve
Step 5: Setup Database
- Start XAMPP and ensure MySQL is running.
- Open
http://localhost/phpmyadmin
in your browser and create a new database namedsimple_project
. - In your project directory, open the
.env
file and updateDB_DATABASE
with the name of the database you created. - Open
config/database.php
and ensure the MySQL engine is set toInnoDB
.
Step 6: Serve Your Laravel Application
- Use the command
php artisan serve
to start your Laravel application. - Access the application by navigating to
http://127.0.0.1:8000
in your browser.
How to configure & add php artisan serve in phpstorm laravel 10
Sources :
- https://www.jetbrains.com/help/phpstorm/laravel.html#debugging-artisan-commands
- https://stackoverflow.com/a/63568674/10216101
Open Run/Debug configration , php script > select the artisan file path , (command Line / interpreter ) php version & your .env path.
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