Home > Article > Development Tools > How to install composer
How to install composer?
Domestic friends may encounter many problems when installing composer. When I first installed composer, I also took a lot of detours. Now I recommend a quick way to install composer. Open the command line and execute the following command:
Before using these commands, first confirm that it has been installed. php, and set php in the global variable. Open the command line and enter php -v to see the php version information
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" php composer-setup.php php -r "unlink('composer-setup.php');"
Related recommendations: [composer tutorial 】
Please enter the above three items in order. The functions are
1. Download the installation script - composer-setup.php - to the current directory.
2. Execute the installation process.
3. Delete the installation script.
For the specific installation process, please check the detailed description of composer China Mirror Website.
Please see how to install globally:
After setting up, enter composer on the command line to see the composer version information.
In the next article, we will continue to introduce how to use composer.
The above is the detailed content of How to install composer. For more information, please follow other related articles on the PHP Chinese website!