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

Let's talk about how to install composer on ubuntu

藏色散人
Release: 2021-11-02 16:02:27
forward
3043 people have browsed it

This article is provided by the composer tutorial 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
Copy after login

2. Rename composer.phar to composer

mv composer.phar composer
Copy after login

3. Add executable permissions

chmod +x composer
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:juejin.im
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template