Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Linux/Install Laravel 5.5 on Ubuntu 16.04

November 28, 2017

Install Laravel 5.5 on Ubuntu 16.04

Laravel is a MVC framework for PHP. The latest Laravel release is version 5.5 in July 2017. Laravel 5.5 requires PHP 7 and higher. The latest stable release of PHP is 7.1. The following instructions walks you through how to install Laravel 5.5 on Ubuntu 16.04 LTS.

Update

sudo apt-get update
sudo apt-get upgrade

sudo apt-get update sudo apt-get upgrade

Install Apache

# install apache
sudo apt-get install apache2
# start apache
sudo systemctl start apache2
# enable on startup
sudo systemctl enable apache2

# install apache sudo apt-get install apache2 # start apache sudo systemctl start apache2 # enable on startup sudo systemctl enable apache2

Install PHP 7

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.1 php7.1-xml php7.1-mbstring php7.1-mysql php7.1-json php7.1-curl php7.1-cli php7.1-common php7.1-mcrypt php7.1-gd libapache2-mod-php7.1 php7.1-zip

sudo apt-get install python-software-properties sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt install php7.1 php7.1-xml php7.1-mbstring php7.1-mysql php7.1-json php7.1-curl php7.1-cli php7.1-common php7.1-mcrypt php7.1-gd libapache2-mod-php7.1 php7.1-zip

Install Composer

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/bin/composer

curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/bin/composer

Change Permissions

# add new user to www-data group
sudo useradd -g www-data ubuntu
# add existing user to www-data group
sudo usermod -a -G www-data ubuntu
# change ownership
sudo chown -R ubuntu:www-data /var/www
# change permissions
sudo chmod -R g+rwx /var/www

# add new user to www-data group sudo useradd -g www-data ubuntu # add existing user to www-data group sudo usermod -a -G www-data ubuntu # change ownership sudo chown -R ubuntu:www-data /var/www # change permissions sudo chmod -R g+rwx /var/www

Install Laravel 5.5 via Composer

composer create-project laravel/laravel /var/www/html/web

composer create-project laravel/laravel /var/www/html/web

Make Storage Writeable

sudo chmod -R 777 /var/www/html/web/storage

sudo chmod -R 777 /var/www/html/web/storage

Set Document Root in Apache

sudo nano /etc/apache2/sites-available/000-default.conf
# change DocumentRoot to laravel/public
DocumentRoot "/var/www/html/laravel/public"
# Save and Exit

sudo nano /etc/apache2/sites-available/000-default.conf # change DocumentRoot to laravel/public DocumentRoot "/var/www/html/laravel/public" # Save and Exit

Restart Apache

sudo systemctl restart apache2

sudo systemctl restart apache2

There you have it. Laravel 5.5 on Ubuntu 16.04 LTS. Enjoy.

Filed Under: Linux Tagged With: laravel 5.5, ubuntu 16.05 lts

Have content delivered to your mail. Subscribe below.

About Me

I'm Ulysses, Cloud Engineer at Cardinal Health based in Columbus. This blog is about Linux and Cloud technology. When off the grid, I enjoy riding my electric skateboard. I've surfed, snowboarded and played the saxophone in the past. I hope you find this website helpful. It's powered by WordPress and hosted on AWS LightSail.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021