Installing XAMPP, Composer, and Laravel 12: Step-by-Step Setup for Newbies

Author

Kritim Yantra

May 20, 2025

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

  1. Go to https://www.apachefriends.org
  2. Choose your OS (Windows / macOS / Linux)
  3. Download the latest version (PHP 8.x recommended)

🛠️ Install and Launch

  1. Run the installer
  2. Select components (keep default checked: Apache, MySQL, PHP)
  3. Choose install location (e.g., C:\xampp)
  4. 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

🛠️ Install Composer

  1. Run the installer
  2. Choose the PHP path (e.g., C:\xampp\php\php.exe)
  3. 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:

  1. Open XAMPP Control Panel and start MySQL
  2. Visit http://localhost/phpmyadmin
  3. Create a new database (e.g., laravel_db)
  4. Open .env file 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 serve inside your Laravel folder
  • To stop the server, press Ctrl + C in 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! 🔥

Tags

Comments

No comments yet. Be the first to comment!

Please log in to post a comment:

Sign in with Google

Related Posts

Getting Started with Laravel Starter Kits: Build Apps Faster
Kritim Yantra Kritim Yantra
Feb 24, 2025
Laravel 12 CRUD Tutorial: Build a Complete Blog with Image Upload
Kritim Yantra Kritim Yantra
Feb 28, 2025
Complete Laravel 12 CRUD Guide: Using Laravel UI, Bootstrap & Blade
Kritim Yantra Kritim Yantra
Mar 09, 2025