How To Install Laravel on Ubuntu

Leave a Comment

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 4, 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 4


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.

Get more laravel or other tutorial here

If This help you Please Comment

Helpful links


0 comments:

Post a Comment

Powered by Blogger.