Skip to content

Installing Laravel 5.3 with Composer on Ubuntu

Hi Pals recently i had been stared developing on laravel and i got many issues while installing laravel. I was new to Composer and Laravel so it was enough time consuming installing and tweaking setting so i plan to write a guide, that might help you.

I Have Linux Ubuntu 16.0 LTS Install and LAMP Installed.

OS: Linux Ubuntu 16.0 LTS

Server version: Apache/2.4.18 (Ubuntu)
Server built:   2016-07-14T12:32:26

mysql  Ver 14.14 Distrib 5.7.13, for Linux (x86_64) using  EditLine wrapper

PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies

Ok So these were the package version.

Step One: Install Composer.
sudo apt-get install composer

To Find out composer version type:
composer --v
Composer version @package_branch_alias_version@ (1.0.0-beta2) 2016-03-27 16:00:34

Step two: Install Laravel Installer

virgo@virgo-pc: composer global require "laravel/installer"

if the command run successfully move to [On success] section if you got any errors similar to me i had wrote solutions read more.

Errors that occur during installation.

1-

Solution :

virgo@virgo-pc: composer clear
Clearing cache (cache-dir): /home/virgo/.cache/composer
Clearing cache (cache-files-dir): /home/virgo/.cache/composer/files
Clearing cache (cache-repo-dir): /home/virgo/.cache/composer/repo
Cache directory does not exist (cache-vcs-dir):

All caches cleared.

2-

Solution: This Happens if you are using any kind of proxy or if you are not using proxy but the variables $http_proxy and $https_proxy is set.

If you are using proxy do this

virgo@virgo-pc: set http_proxy= "http://username:[email protected]"

virgo@virgo-pc: set https_proxy= "http://username:[email protected]"

If you are not using proxy verify the variable value by.

virgo@virgo-pc: echo $http_proxy

virgo@virgo-pc: echo $https_proxy

if any of this give you any value you have to unset these variables by

virgo@virgo-pc: unset http_proxy


virgo@virgo-pc: unset https_proxy

if you are getting some other error you have to google it.

Thats it now run again

virgo@virgo-pc:
composer global require "laravel/installer"

[On success]

i hope this will now end with successful installation

Step three: Configure Laravel Installer executeable.

Open .brashrc and add the the below line at the bottom

export PATH=”/home/virgo/.config/composer/vendor/bin:$PATH”

virgo@virgo-pc: nano ~/.bashrc

export PATH=”/home/virgo/.config/composer/vendor/bin:$PATH”

CTRL+X to save

now reload bashrc run this command

virgo@virgo-pc: source ~/.bashrc

Now you had successfully configured the laravel installer executable.

Step Four: Create Laravel Project

virgo@virgo-pc: laravel new blog

this will create a laravel project for you. congratulations you had successfully installed and configured laravel installer.

Kindly comment and share you feedback. Thanks

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*