Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The method of installing composer in windows

Shulou Source: shulou.com Published: 2022-06-02 15:09:28 11月01日 Update

This article mainly introduces the method of installing composer in windows, which is very detailed and has certain reference value. Friends who are interested must finish it!

I.

Make sure the php environment variable is set and the address of the variable is the directory where php.exe is located

Run php-v to return the php version

II.

Php-r "copy ('https://install.phpcomposer.com/installer',' composer-setup.php');" php composer-setup.phpphp-r "unlink ('composer-setup.php');"

The composer-setup.php script downloaded from the first command will simply detect the parameter settings in php.ini, give a warning if some parameters are not set correctly, and then download the latest version of the composer.phar file to the current directory.

The functions of the above three commands are as follows:

1. Download the installation script-composer-setup.php-to the current directory.

two。 Perform the installation process.

3. Delete the installation script.

3.

Windows system:

1. Locate and enter the directory where PHP is installed (the same set of PHP as the php instructions you executed on the command line).

two。 Copy composer.phar to the installation directory of PHP, that is, at the same level as php.exe.

3. Create a new composer.bat file under the PHP installation directory and save the following code to this file.

4.@php "% ~ dp0composer.phar"% *

Finally, reopen a command-line window and try to execute composer-- version to see if you have typed the publication number correctly.

IV.

Composer config-g repo.packagist composer https://packagist.phpcomposer.com above is all the content of this article "how to install composer in windows". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Directory command file version script method content parameter variable article that is code value function interest address partner place instruction Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Information Shulou Tech Info Microsoft MariaDB