How to Install Laravel – The PHP Framework

Laravel is a open-source web application framework with expressive, elegant syntax. Laravel uses the Model-View-Controller approach, which allows great separation between logic and presentation.

In this article, we’ll see step by step – How to install laravel?

At first you must have composer installed on your system. Composer is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries.

There are two ways to install Laravel

  • via Laravel Installer
  • via Composer Create-Project.

Laravel Installation Via Laravel Installer

Open the command prompt or terminal and run the below command.

   composer global require "laravel/installer"




Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new MyFirstLaravelProject will create a directory named MyFirstLaravelProject containing a fresh Laravel installation with all of Laravel’s dependencies already installed:

   laravel new MyFirstLaravelProject

Here MyFirstLaravelProject is the name for your project.

Laravel Installation Via Composer Create-Project

Open the command prompt or terminal and run the below command.

   composer create-project --prefer-dist laravel/laravel MyFirstLaravelProject

Here also MyFirstLaravelProject is the name of your project.

Once you have done with the installation. You may use the serve Artisan command.

   php artisan serve

This command will start a development server at http://localhost:8000

Open the browser and run the URL http://localhost:8000

You’ll see Laravel’s home page.

That’s it!, We’ve completed the Laravel Installation. Please share your thoughts or suggestions in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *