Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Download and Install Composer on Linux

By editor , 20 July, 2017
Question

How to install Composer on Linux (Debian, Ubunto, Mini ...)

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Download Composer

Link : https://getcomposer.org/download/

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

Note : For the security, you can check the setup file using SHA hash.
Fot that, get the latest version from https://getcomposer.org/download
Example :
#php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"


Move composer to bin

Make `composer` executable as a command from anywhere. Destination can be anywhere on $PATH.

mv composer.phar composer
chmod +x composer
sudo mv composer /usr/local/bin


Check composer version

composer --version

Now you can use composer form anywhare

Follow this tutorial to install drupal via composer

Tags

  • Drupal 8
  • Code
Install and Update Composer
Get composer instalation path
Create a Drupal 9 Project using composer.
Manage custom package using composer.

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer