Home>Article>Development Tools> Let’s talk about how to install composer on ubuntu

Let’s talk about how to install composer on ubuntu

藏色散人
藏色散人 forward
2021-11-02 16:02:27 2921browse

This article is provided by thecomposertutorial column to introduce how to install composer on ubuntu. I hope it will be helpful to friends in need!

Let’s talk about how to install composer on ubuntu

1. Download composer.phar

wget https://getcomposer.org/composer.phar

2. Rename composer.phar to composer

mv composer.phar composer

3. Add executable permissions

chmod +x composer

You can now run composer through the ./composer command, but this is only limited to the current directory. If you want to use composer globally, you need to set it as a global variable. Find the composer file and move it to the /usl/local/bin directory so that the composer command can be used globally.

sudo mv composer /usr/local/bin

When the above command is executed, if you are not the root user, you will be asked to enter your password.

Test whether the installation is successful

composer --version

The above is the detailed content of Let’s talk about how to install composer on ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete