Quick Guide: Installing Laravel and Composer

Публикувано на 08.06.2017
Quick Guide: Installing Laravel and Composer

Introduction

Before starting to code with Laravel, we need to install Composer and ensure the environment is set up properly.


Requirements

  • PHP >= 5.6.4
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

Once these are ready, proceed to install Composer.


Installing Composer

Windows: download the installer from getcomposer.org and follow the steps.

Linux (Ubuntu):

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Installing Laravel

Once Composer is ready, install Laravel globally:

composer global require "laravel/installer"

Create a new Laravel project:

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

Then open http://localhost/blog/public/ — if you see the Laravel welcome page, everything is set up correctly.


Fixing Permissions

If you run into permission issues, run the following commands:

sudo chmod 755 -R blog
chmod -R o+w blog/storage

After that — Let the coding begin!