Skip to content

How to install Laravel 5

Last updated on February 17, 2018

In this post, I am going to share Laravel installation steps. We Can install Laravel by using composer and Laravel installer. Laravel Installer is a new feature which is introduced in Laravel 4.1, which can create a project in a few seconds and is much faster than Composer.

NOTE – I assume you have PHP and Composer in your system PATH already.

Laravel5 Installation using Laravel Installer:

First of all we need to download and set up Laravel Installer using Composer, which is a one-time process. Open up Terminal and run the following command:

 composer global require "laravel/installer=~1.1"

Make sure to place the ~/.composer/vendor/bin the directory in your PATH so the laravel executable is found when you run the laravel command in your terminal.

For windows users path would be – C:\Users\\AppData\Roaming\Composer\vendor\bin. You can place this directory path in your PATH environment variable by issuing – setx /M path "%path%;%appdata%\Composer\vendor\bin" command via command prompt with admin privileges.

Once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify and this laravel command will be available anywhere in the system.

Now you are ready to create your first Laravel 5 project using Laravel Installer. Simply run the following command in terminal:

laravel new blog

It would create a directory named blog containing a fresh Laravel installation with all dependencies installed.

Laravel5 Installation using composer:

Simply run the following command in terminal:

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

–prefer-dist: Reverse of –prefer-source, Composer will install from dist if possible. This can speed up installs substantially on build servers and other use cases where you typically do not run updates of the vendors. It is also a way to circumvent problems with git if you do not have a proper setup.

Above command will start downloading all Laravel dependencies and will set up a new project in the specified directory.

Laravel5 installation by downloading

Below are simple steps –
1. Download Laravel form GitHub – https://github.com/laravel/laravel. Unzip it in your server project folder.
2. Open your terminal and navigate to project folder and run composer update command.
3. Once installed, generate key php artisan key:generate and change database settings and other settings like debugging mode..etc.
4. Now point your browser to your hostname and project name, mine is – http://localhost/laravel

That is it.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments