Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between composer and composer.phar

Tags:

composer-php

What is the difference between composer and composer.phar?

Example:

  • composer install
  • composer.phar install

Is there a reason why I keep seeing code writen using composer.phar all the time when composer does the same?

like image 675
denOldTimer Avatar asked Mar 07 '23 23:03

denOldTimer


1 Answers

There is no difference - composer.phar is the executable and composer can be an alias or symlink for it, depending on the way you've installed composer. As rob006 pointed out, there can be multiple ways to install composer: the official documentation at https://getcomposer.org/doc/00-intro.md#globally recommends to move the downloaded PHAR file to /usr/local/bin/composer which will make it callable through composer for all users of your system.

If you would move the file to another destination, like /usr/local/bin/composer.phar, the same composer binary would be available under that different command composer.phar.

And finally, if you would not have the chance to install composer globally, you could put it under either name in any local place

like image 81
Nico Haase Avatar answered Apr 29 '23 17:04

Nico Haase