Step by Step Installation Laravel 5 On Ubuntu for Beginners – Laravel is different from other PHP framework, where you can download the master file fully and placed on your web server. Laravel has a dependence on some PHP library, where the library isn’t included in the laravel’s source. So we need to download the library separately.

Is laravel installation complicated ??

In my opinion, extremely complicated. This might be the first PHP framework I am trying to learn. Probably for those professionals who familiar with composer, lavarel installation becomes very easy. One of the interesting things of the laravel framework is about Composer. The whole requirement done by the composer, so any dependency with other libraries can be resolved by the composer. In other words, we don’t need to download one by one libraries needed by laravel. The principle is similar to apt-get in linux or NPM in nodejs. Because Composer is cool stuff, then there is no harm in us to install it first.

This article discusses how to install laravel on the ubuntu operating system, for Windows’s users, there could be some similarities, because using the composer.

How to install laravel 5 on ubuntu for beginners

In laravel official site has been described in detail how to install laravel 5 step by step. But still some starters like me failed to do the installation. Here are the steps :

Laravel need requirement as follows

  • PHP >= 5.5.9
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension

Make sure you have fulfilled the above request

Install the composer on ubuntu / linux

How to install the composer on linux easy enough. According run the following script on the terminal ubuntu

We will get composer.phar file in the directory where we run the script above

Please check with the command “php composer.phar” on terminal,┬áif it looks like the image below, you have successfully perform the installation composer on ubuntu

How To Install Composer On Ubuntu Step By Step Install Laravel 5 On Ubuntu

So that we can use composer in any folder , please move the composer.phar to /usr/local/bin/composer

mv composer.phar /usr/local/bin/composer

For windows’s users please use the following links

Installation laravel 5

Please go to the web server folder ( cd /var/www/html/ ). Then run the following script to download laravel by composer

composer create-project laravel/laravel {directory} "~5.0.0" --prefer-dist


composer create-project laravel/laravel laravelApp "~5.0.0" --prefer-dist

Install Laravel 5 On Ubuntu Machine

Wait composer download files until completion. Then type ls on ubuntu terminal, you will find laravelApp folder that contains the complete file.

Then go to the laravelApp folder and run the command “composer update” to perform the update dependencies on laravel. But when doing the composer update, I had an error like below

- laravel/framework v5.0.9 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.

Laravel Framework V5.0.9 Requires Ext Mcrypt

Don’t worry, you only need to install the ext-mcrypt on your php server. Here are the steps to install ext-mcrypt on php ubuntu :

sudo apt-get install mcrypt php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart

If you’re windows user, i found link that can help you to resolve ext-mcrypt problems

Do the composer update again

composer update

Composer Update Step By Step Installation Laravel 5 On Ubuntu For Beginners

Installation laravel 5 has finished, please check on your browser http://localhost/laravelApp/public/

Check what happened? you will only be given a white screen on your browser. In order to run normally, we have to change the file permissions on the storage’s folder with code below

chmod -R o+w storage/

Change Permission Storage Folder On Laravel Step By Step Installation Laravel 5 On Ubuntu For Beginners

Check again on your browser and voila, You have successfully installed laravel 5 on your machine

Step By Step Installation Laravel 5 On Ubuntu For Beginners

Until this point we have managed to install laravel 5. Here are some of errors that occur when you install laravel 5, may be able to help solve your problem.

1. No folders vendor on laravel application

Laravel Installation Error Step By Step Installation Laravel 5 On Ubuntu For Beginners

Solutions :

Please check the vendor’s folder in the ~/.composer/ and then copy the vendor’s folder to your application folder

Laravel Error Installation Vendor Folder Not Found

If no vendor’s folder in ~/.composer please run the following code at the terminal

composer global require "laravel/installer"

2. Error call to undefined method illuminate\Foundation\application::getCachedCompilePath().

Error Call To Undefined Method Illuminate Foundation Application GetCachedCompilePath Error Install Laravel 5

Solution :

Delete the vendor/compiled.php and run composer update again. Or also delete the storage/framework/compiled.php.

Hopefully the above tutorial can help you.

Thus article step by step installation laravel 5 on Ubuntu for beginners, hope useful

The following two tabs change content below.
This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

1 Comment

 Add your comment
  1. Holy cow dude, I want to kiss you! Thanks for this awesome guide!

    Something that I (A complete apache buffoon) ran into was this:
    The folder name in the /var/www/your_folder_name had to be /var/www/html to work. (Yeah, I know, I should configure apache) .

    Again, Many thanks!

Leave a Comment

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.