composer installation on aws ec2 instance ami ubuntu 18.04

Ziaur Rahman
Nov 1 · 2 min read

Introduction:
Composer is not a package manager like yum/apt, it is a tool for dependency management in php. It allows to declare the libraries that your project depends on and it will manage ‘install/update’ the libraries for your project. Now you are thinking that it’s not dealing with packages? yes it deals with ‘packages’ and ‘libraries’ and it manages all packages and libraries per project basis, installing them into a directory (as for vendor) inside your project. Actually it doesn’t install anything globally that’s why it is a dependency manager.

Tech Details:
aws ec2, amazon machine image ubuntu 18.04, Nginx(1.14), php(7.3).

Requirement:
1. aws account access
2. running ec2 instance
3. accessing the ec2 instance, if can’t access please visit blogspot or medium
4. nginx installation, if not installed please visit blogspot or medium
5. php installed. if not, to install follow the tutorial visit blogspot or medium

Step1: install ‘unzip’ and ‘git’ package, they are needed to install composer
$ sudo apt update
$ sudo apt install unzip
$ sudo apt install git

Step2: go to the following url https://getcomposer.org/download/ and execute the following command

$ php -r “copy(‘https://getcomposer.org/installer', ‘composer-setup.php’);”

$ php -r “if (hash_file(‘sha384’, ‘composer-setup.php’) === ‘a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”

$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
$ php -r “unlink(‘composer-setup.php’);”

Step3: execute the command

$ composer

And you will see the following screen on your terminal

BOOOOOOOOOMMMMMMEEEEEDDDDDDDDDDDDD …………………..


Originally published at http://zrshishir.blogspot.com.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade