Home>Article>Development Tools> How to solve bash: composer: command not found problem
Have you ever encountered the problem bash: composer: command not found? How to solve it? Thecomposertutorial 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
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" } }
composer image Installation method
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!