1. Home
  2. PHP
  3. Installing Laravel

Installing Laravel

Overview

Laravel is a PHP framework built around abstraction: do more with less coding. Laravel runs off PHP and MySQL. It is supported on any package, but works best with a package that supports terminal access. For this guide, we will assume terminal access is available.

Installation

Begin by logging into the terminal.

  1. PREREQUISITE: Install Composer if it has not already been installed.
  2. Install Laravel in a new directory called laravel/ under /var/www using Composer:
    cd /var/www
    composer create-project laravel/laravel laravel

    Note: “laravel” is intentionally present 3 times, the argument format to composer create-project is channel/package directory

  3. Change permissions on Laravel asset directories to permit write-access of logs, compiled views, and temporary file storage.
    cd laravel/
    chmod -R 777 storage bootstrap/cache
  4. Connect Laravel to a subdomain or addon domain within the control panel under Web > Subdomains. Specify public/ for its document root; in the above example, this path is /var/www/laravel/public

Empty output

Certain combinations of Laravel and PHP may yield a page without content. In such situations, turn off output_buffering in the .htaccess file located under public/:

php_value output_buffering 0

See also

Updated on March 7, 2021

Related Articles