Laravel - Installation

Laravel - Installation

Laravel Installation Guide

Laravel can be installed in several ways, but the recommended way is via Composer.

Prerequisites

Before installing Laravel, make sure you have:

1. PHP (Version 8.1 or higher recommended)

Check:

php -v

2. Composer (Dependency manager for PHP)

Check:

composer -V

If Composer isn’t installed, download it here:
👉 https://getcomposer.org/download/

3. A Web Server (like Apache or Nginx)

You can use XAMPP, MAMP, or Laragon (for Windows).

Step 1: Install Laravel via Composer

Open your terminal and run:

composer create-project laravel/laravel project-name

Replace project-name with whatever you want to name your app.
Example:

composer create-project laravel/laravel myapp

This will:

  • Download Laravel

  • Set up dependencies

  • Create a new project folder

Step 2: Navigate into the Project Folder

cd myapp

Step 3: Start the Laravel Development Server

Run:

php artisan serve

Output:

Starting Laravel development server: http://127.0.0.1:8000

Now, open your browser and go to http://127.0.0.1:8000
You should see the Laravel welcome page.

Optional: Verify Laravel Version

php artisan --version

Alternative: Use Laravel Installer

If you prefer using the Laravel Installer globally:

1. Install via Composer:

composer global require laravel/installer

Make sure Composer's global bin directory is in your $PATH.

Then, create a project:

laravel new myapp cd myapp php artisan serve

Laravel Installed! What Next?

You can now:

  • Set up your .env file

  • Configure database connection

  • Create routes, controllers, and views

  • Start building your application!

Soeng Souy

Soeng Souy

Website that learns and reads, PHP, Framework Laravel, How to and download Admin template sample source code free.

Post a Comment

CAN FEEDBACK
close