CARA INSTALL COMPOSER ON UBUNTU 18.04

 


Langkah 1 - Install Depedencies Ubuntu

byan@byan-linux:~$ sudo apt update

byan@byan-linux:~$ sudo apt install curl php-cli php-mbstring git unzip


Langkah 2 - Download Composer

byan@byan-linux:~$ cd ~

byan@byan-linux:~$ curl -sS https://getcomposer.org/installer -o composer-setup.php

setelah command di atas silahkan akses situs berikut ini https://composer.github.io/pubkeys.html untuk mendapatakan Installer Checksum (SHA-384) Seperti Gambar dibawah ini : 


Langkah 3 - Membuat Variabel HASH=   dan Verifikasi file Composer dengan HASH dari HASH SHA-384

byan@byan-linux:~$ HASH=795f976fe0ebd8b75f26a6dd68f78fd3453ce79f32ecb33e7fd087d39bfeb978342fb73ac986cd4f54edd0dc902601dc

byan@byan-linux:~$  php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Output

Installer verified


Langkah 4 - Install Composer

byan@byan-linux:~$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Kamu akan melihat outputnya seperti dibawah ini:

Output
All settings correct for using Composer Downloading... Composer (version 1.6.5) successfully installed to: /usr/local/bin/composer Use it: php /usr/local/bin/composer

Langkah 5 - Test Composer

byan@byan-linux:~$ composer

Kamu akan melihat outputnya seperti dibawah ini:

Output
______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Composer version 1.10.13 2020-09-09 11:46:34 Usage: command [options] [arguments] Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output

Ori Grata

Abstrak

Please Select Embedded Mode For Blogger Comments

أحدث أقدم

Ikuti lewat Email

Advertisement