Home > Development Tools > composer > How to solve bash: composer: command not found problem

How to solve bash: composer: command not found problem

藏色散人
Release: 2021-07-09 16:38:31
forward
7020 people have browsed it

Have you ever encountered the problem bash: composer: command not found? How to solve it? The composer tutorial column will introduce the solution to this problem in detail below.

1. Check the error report first

2. Due to wrong reasons, the installation of many things failed. Some people on the Internet said it was a problem with environment variables, but they couldn't find a solution after looking for it. Later, I saw a simple and crude method and tried it and it succeeded.

3. I use phpstudy and put PHPStudy\PHPTutorial Copy composer.phar and composer.bat in the \tools\composer folder to the folder of the currently used version, and copy compo.phar and rename it to composer

3. Execute the following command to update your composer version

composer config repo.packagist composer https://packagist.phpcomposer.com
Copy after login

4. After the execution is completed, you will see a line of code in the composer.json file of your project

"repositories": {
    "packagist": {
        "type": "composer",
        "url": "https://packagist.phpcomposer.com"
    }
}
Copy after login

composer image Installation method

Method 2:

Download the composer installation package: composer download address

Download and install. Follow the steps below to install:

Then proceed to the next step. When you reach the following interface, the installation is successful:

Test whether composer is installed successfully:

The above is the detailed content of How to solve bash: composer: command not found problem. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
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