Friday, March 2, 2018

How to Install Laravel


Installing Laravel

Laravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine.

Laravel require must be attention you can read on this Laravel Requirements.

Via Laravel Installer

First, download the Laravel installer using Composer:
composer global require "laravel/installer"

Make sure to place composer's system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:
macOS: $HOME/.composer/vendor/bin 
GNU / Linux Distributions: $HOME/.config/composer/vendor/bin 
Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blogcontaining a fresh Laravel installation with all of Laravel's dependencies already installed:
laravel new blog

Via Composer Create-Project

Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:

Laravel 5.2

composer create-project --prefer-dist laravel/laravel blog "5.2.*"

Laravel 5.3

composer create-project --prefer-dist laravel/laravel blog "5.3.*"

Laravel 5.4

composer create-project --prefer-dist laravel/laravel blog "5.4.*"

Laravel 5.5

composer create-project --prefer-dist laravel/laravel blog "5.5.*"

Laravel 5.6

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

Local Development Server

If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application, you may use the serve Artisan command. This command will start a development server at http://localhost:8000:
php artisan serve
Look like this:

Of course, more robust local development options are available via Homestead and Valet.

DONT FORGET Change Directory Permissions

After installing Laravel, you may need to configure some permissions. Directories within the 
directory storage and the bootstrap/cache on your project directory

you can use chmod -R 777 storage and chmod -R 777 bootstrap/cache on directory project
should be writable by your web server or Laravel will not run. If you are using the Homestead virtual machine, these permissions should already be set.

Disqus Comments