Laravel Installation

0
80
Laravel Installation

Before installing the Laravel framework, you need to have a Composer which can help you in managing the Laravel’s dependencies.

Step 1: Download Composer

Get a copy of Composer, composer.phar by visiting the URL: https://getcomposer.org/download/

Note: Once you download the copy of PHAR archive, you can keep this Composer either in the local directory or in the global directory. To use the Composer globally on your system, move the PHAR archive to the usr/local/bin.

Step 2: Confirm the installation of Composer

Use the command prompt to check if the composer is really installed on your system. Type the following commands to the cmd.

C:\wamp\www\laravel>php artisan –version

Laravel Framework version 5.1.23 (LTS)

C:\wamp\www\laravel>cd\

C:\>composer

The above series of commands will verify the installation of Composer on your system.

Step 3: Install Laravel

Installation of Laravel can be done by 3 processes.

  • Using Laravel Installer

For this, you need to begin by downloading a Laravel installer with the help of the Composer.

Use the command: composer global require “laravel/installer=~1.1”

Note: Appropriately place the executable laravel in your path.

Once finished with the installation of the Laravel installer, type in the following commands to install the Laravel in the specified directory.

Command: laravel new {directory}

How to use the above command?

laravel new xyz

The command will create a new directory under the xyz name. This directory will be having a new Laravel with all the dependencies installed in it. This approach of installing Laravel is faster than the method of installation using Composer.

  • Using Composer

Use the below command to create a project which will help in Laravel installation:

Command: composer create-project laravel/laravel {directory} 4.2 –prefer-dist

The output of the above command will be a URL. Paste the given URL into the browser and a Laravel 5 webpage will appear in front of you. The webpage suggests that the installation has been successful.

  • Direct Download

After the successful installation of the Composer, download the Laravel framework from the provided URL.

https://github.com/laravel/laravel/archive/v4.2.11.zip

Next step would be to extract the contents of the downloaded directory. Now, type in the following command to install all the dependencies of the framework.

Command: php composer.phar install

Or          composer install

Note: This method strictly requires an installed Git on your server. Later on, to update the framework, you can use the command: php composer.phar update.