Wednesday, October 5, 2022
PHP Rocky Linux

Install PHP Composer pada Rocky Linux

composer

Pada kesempatan kali ini saya akan membahas cara Install PHP Composer pada Rocky Linux.

A. Install local directory
1. Composer membuatuhkan PHP 5.3.2+ untuk bisa di jalankan. Anda bisa lihat artikel ini untuk cara install php nya .
misal disini saya sudah install php 7.2

php -v

PHP 7.2 (cli) (built: May 12 2020 08:09:15) ( NTS )

2. download php composer script

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

3. verify

php -r "if (hash_file('sha384', 'composer-setup.php') === '$(wget -qO - https://composer.github.io/installer.sig)') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

4. install php composer

php composer-setup.php

5. delete installer

php -r "unlink('composer-setup.php');"

6. verify php composer

php composer.phar

B. Install di globall envi

1. install php composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

php -r "if (hash_file('sha384', 'composer-setup.php') === '$(wget -qO - https://composer.github.io/installer.sig)') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

php composer-setup.php --install-dir=/usr/bin --filename=composer

php -r "unlink('composer-setup.php');"

2. jalankan composer

php composer.phar
composer -V

(Visited 49 times, 1 visits today)
Klik untuk berbagi dengan orang lain
Baca Juga :  Cara Install PHP pada Almalinux 8

Similar Posts