Installation of composer under windows

How to install composer on the windows side is actually very simple. The official website of composer also has tutorials. Next, I will demonstrate:

  1. You can view  the steps 1-3 of the installation of composer under linux,   which are omitted here. Click Install-Windows on the composer documentation page:

  2. There are also two installation methods here, using the installer to install and manual installation. Under Windows, I personally prefer to use the installer to install this method. First download the installation file:

  3. Before installing the program, it is necessary to understand that the execution of composer requires php commands. Let's first check whether our php commands can be executed normally:

  4. At present, I am executing the php command and reporting an error, not an internal or external command (of course, if you execute the php command without reporting an error, it means that your php command can be executed normally), which means that your php is not global. (Only some places can be called, not all places in the whole system), so what to do? There is a way, you can use a full path to call (I use the PhpStudy integrated environment, no matter which integrated environment is used, you need to find the php executable program to determine this path):

  5. I am using the PHP 5.6.27 version here, then you can find the php executable file under the php 5.6.27 version path through this

 

  6. Then use this path to call php, you can see that there is no error:

   7. But you can't write such a long path every time you call the php command, then we need to turn it into a global path, how to turn it into a global path, first go to your desktop (I use windows7 ), right-click "Computer", then click Properties, then click Advanced System Settings, then click Environment Variables, find the Path variable, click Edit, and add the path to the php executable after the variable value (Note: mine is D:\phpStudy \php\php-5.6.27-nts , a simple path, does not include executable files, add a semicolon before adding, and add a semicolon after adding it. The semicolon needs to be semi-rounded in English. !), then OK.

  8. Next, close the terminal, and then open it again. You can see that running the php command directly will not report an error:

  9. The next step is to install our composer, just double-click to open it:

  10. Then the next step, because we have configured the global path of php before, so the path will be automatically obtained here, the next step is to go to the next step foolishly, no other operations are required:

  11. After the installation is complete, open our terminal and run the composer command. If you see the interface in the figure below, instead of reporting an error saying that it is not an internal command, it means that your composer has been installed successfully:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324493947&siteId=291194637