Installing XAMPP, Composer, and Laravel 12: Step-by-Step Setup for Newbies
Starting your Laravel journey but confused about where to begin?
You’ve probably heard terms like XAMPP, Composer, and Laravel, but setting them up can feel overwhelming—especially if you're new to PHP development.
Don’t worry! This guide will walk you through every step with clarity, screenshots (optional), and code examples to help you set up your Laravel development environment in no time. 💻✨
🧰 Tools You’ll Install
| Tool | Purpose |
|---|---|
| XAMPP | Provides PHP, MySQL, and Apache – your local server stack |
| Composer | Dependency manager for PHP (like npm for Node.js) |
| Laravel | The PHP framework for building web apps |
✅ Step 1: Install XAMPP
🔗 Download XAMPP
- Go to https://www.apachefriends.org
- Choose your OS (Windows / macOS / Linux)
- Download the latest version (PHP 8.x recommended)
🛠️ Install and Launch
- Run the installer
- Select components (keep default checked: Apache, MySQL, PHP)
- Choose install location (e.g.,
C:\xampp) - Finish and launch the XAMPP Control Panel
🚦 Start Services
- Click Start next to Apache and MySQL
- Make sure they turn green ✔️
✅ Great! Your local server is up and running.
✅ Step 2: Install Composer
🔗 Download Composer
- Visit: https://getcomposer.org/download
- Download the Composer-Setup.exe (for Windows)
🛠️ Install Composer
- Run the installer
- Choose the PHP path (e.g.,
C:\xampp\php\php.exe) - Finish installation
✅ Check Installation
Open Command Prompt or Terminal and run:
composer -v
You should see version details. If yes — ✅ Composer is ready!
✅ Step 3: Install Laravel via Composer
Now let’s bring in Laravel!
📁 Choose Your Project Directory
We’ll create your first Laravel project inside XAMPP’s htdocs folder:
cd C:\xampp\htdocs
📦 Create a Laravel Project
Use this Composer command:
composer create-project laravel/laravel laravelapp
This will:
- Download Laravel
- Set up folders like
routes/,app/,resources/ - Install required packages
Wait for it to finish... ⏳
Once done, you’ll see a new folder laravelapp inside htdocs.
✅ Step 4: Run Laravel Locally
🏃 Start Laravel Development Server
Move into your project directory:
cd laravelapp
Then run:
php artisan serve
You’ll see:
Starting Laravel development server: http://127.0.0.1:8000
🖥️ Open a browser and go to:
http://127.0.0.1:8000
🎉 Boom! You’ve successfully installed and launched your first Laravel app!
✅ Step 5: Optional – Set Up a Database (MySQL)
If you want to connect Laravel to MySQL:
- Open XAMPP Control Panel and start MySQL
- Visit http://localhost/phpmyadmin
- Create a new database (e.g.,
laravel_db) - Open
.envfile in your Laravel app and update:
DB_DATABASE=laravel_db
DB_USERNAME=root
DB_PASSWORD=
That’s it — your Laravel app is now connected to MySQL! 🧠
🧠 Summary
| Step | Action |
|---|---|
| 1️⃣ | Installed XAMPP for PHP, Apache & MySQL |
| 2️⃣ | Installed Composer (dependency manager) |
| 3️⃣ | Created Laravel project using Composer |
| 4️⃣ | Ran Laravel using php artisan serve |
| 5️⃣ | (Optional) Connected Laravel to MySQL |
🧑💻 Tips for Newbies
- Always run
php artisan serveinside your Laravel folder - To stop the server, press
Ctrl + Cin terminal - Make sure Apache and MySQL are running in XAMPP
- Use a code editor like VS Code for best experience
📌 Final Words
Setting up Laravel can be super simple when done step-by-step. With XAMPP, Composer, and Laravel installed, you now have a complete PHP development environment ready to go!
You’re no longer just a beginner — you’re ready to build your first Laravel project! 🔥
Projects to explore next
Source-code projects from the KritiMyantra catalogue. Check each project's details before buying.
Flask Authentication System (Free Version) - Kritim Yantra
🛠 Features✔ Google & GitHub Authentication✔ User Registration & Login✔ Profile/Dashboard Access✔ Secure & Mi...
Flask Blog CMS with Admin Dashboard — Python Source Code
A Flask-based blogging website with a built-in admin dashboard. Manage articles, images, categories, tags and featured p...
Laravel 12 + ReactJS Starter Kit: Add Multi-Language Support (Arabic, English, Spanish) with Blog CRUD
🚀 Installation & Setup Download & Extract Get the ZIP from kritimyantra.com and extract it. Includes preconfigu...
Comments
No comments yet. Be the first to comment.
Sign in to join the discussion.