How To Install Laravel 5 On Ubuntu 14.04 Linux

Published on Author Code Father
How To Install Laravel 5 On Ubuntu 14.04 Linux. Steps To Install Laravel 5 On Ubuntu 14.04

Introduction

Laravel is a framework for websites in the PHP programming language. It allows developers to rapidly develop a website by abstracting common tasks used in most web projects, such as authentication, sessions, and caching. Laravel 5, the newest version of Laravel is based on an older framework called Symfony, but with a more expressive syntax

Step By Step Laravel Install As Follows:

For Users Who Recently Installed LAMP Stack (Linux, Apache, Mysql, PHP) Please install these before proceeding:

Preparing The Server / Environment

Log in into your Ubuntu 12.04 admin and update and upgrade Ubuntu:
sudo apt-get update
sudo apt-get upgrade

Choosing The Right PHP Version

IF You Want: Preparation of installing PHP 5.4: This can be skipped if you are Ok with 5.3. Version
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-cache policy php5

Installing LAMP If You Not Install


sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install mysql-server
sudo apt-get install php5-mysql

Installing PHP Extensions


sudo apt-get install unzip
sudo apt-get install curl
sudo apt-get install openssl
sudo apt-get install php5-mcrypt
Usually these above 4 command not installed,but they are necessary to 1.) unzip uesd for the unzip laravel, 2.) use Composer use curl 3.) use Composer also use openssl 4.) use Laravel 4 (which needs mcrypt).

Enable Apache Mod_rewrite

Apache mod_write module should be enabled in order to use laravel pretty URL’s. So activate the module by typing this in terminal
sudo a2enmod rewrite

Restart Apache


sudo a2enmod rewrite

Install Laravel 5


cd /var/www

composer global require “laravel/installer=~1.1”

composer create-project laravel/laravel –prefer-dist

chmod -R 0777 laravel/app/storage/ Type url in browser http://localhost/laravel/public/
you will see laravel homepage saying 500 Internal server error. To solve the error go to terminal and run this command
sudo nano /etc/apache2/sites-enabled/000-default.conf

Paste this code in that file
<Directory /var/www/> 
  Options Indexes FollowSymLinks MultiViews 
  # changed from None to All 
  AllowOverride All 
  Order allow,deny 
  allow from all 
</Directory> And save that file restart apache using sudo service apache2 restart After that again hit this url http://localhost/laravel/public/ you will get You have arrived.

Comments

comments