Skip to content

Instantly share code, notes, and snippets.

@virbo
Last active October 1, 2019 12:58
Show Gist options
  • Save virbo/c3169ed490564f36f0c239d6fd16f749 to your computer and use it in GitHub Desktop.
Save virbo/c3169ed490564f36f0c239d6fd16f749 to your computer and use it in GitHub Desktop.
Install Composer on CWP (Centos 7)
#!/bin/bash
# Install Composer on Centos, Ubuntu, Debian
# Author Yusuf Ayuba
user_allow="root"
if [ "$(whoami)" != $user_allow ]; then
echo "==================================================================="
echo " Installasi gagal. Install composer harus menggunakan user: "$user_allow" ="
echo "==================================================================="
exit 1
fi
if [ -e /usr/local/bin/composer ]; then
echo "================================================================="
echo "= Installasi gagal, server Anda telah terinstall composer ="
echo "= Jika ingin mengupdate, jalankan perintah composer self-update ="
echo "================================================================="
composer -V
echo ""
exit 1
fi
cd /tmp
clear
echo "================================"
echo "= Download Composer ="
echo "================================"
curl -sS https://getcomposer.org/installer | php
echo "==========================================="
echo "= Make Composer globally accessible ="
echo "==========================================="
cp composer.phar /usr/local/bin/composer
sleep 5s
if [ -e /usr/local/bin/composer ]; then
clear
echo "=============================================="
echo "= Composer berhasil diinstall ="
echo "= Gunakan perintah composer -h untuk bantuan ="
echo "=============================================="
composer -V
echo ""
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment