How to Install Composer in Windows

0
406
How to Install Composer in Windows

Are you thinking of starting your career as a PHP developer? Do you know the Composer is the most used tool by the developers? Do you know why they use it? If you are using a Windows system, do you know how to install Composer in Windows?

If you are starting your career as a PHP developer or working on your project, you must need a Composer to set your libraries and choose the exactly suited package version. So it’s quite tricky to install it on your device. If you are a Windows user then In article will assist you in installing Composer on your Windows system.

Why developers use composers?

Composer is the most reliable dependency manager in the field of PHP, though, it deals with packages. It helps developers to manage the external package and their suited version also helps to set the library for PHP projects. It manages the installation and the updates of the libraries. So doing so the developer doesn’t require making the Webpage or application from the ground-up state.

Overview of Composer

Composer is not an extremely new piece of invention. That idea was previously applied for node and ruby and the functions were npm and bundler accordingly. Composer strongly deals with the libraries or packages but it is not a package manager. It doesn’t do these operations over an on-going project but installs the suited projects in a directory call Vendor. It does not change or installs anything over a Global project bit it supports it with the preloaded global commands. Thus it is known as a dependency manager.

How does it work?

So to explain the job of a Composer we have to show you an example which will help you to get a clear idea about what the Composer does.

Let, you are working on a project which depends on multiple numbers of libraries. Also, few of them depend on some other libraries.

In that case, the composer will help you to declare the libraries on which you depend on. Also, the composer detects the exact suited version of the package that needs to be installed. It also installs the packages in the pre-project state. Also, you can update all the dependencies just with a single command.

System configuration requirements:

The base of Composer id PHP so the first requirement will be the PHP setup. The composer needs the PHP 5.3.2 to run over the system.  If you want to install packages from the source it will depend on the way the package is version controlled. You will require git, fossil, svn, and hg. Composers are supported on multi-platforms like Windows, macOS, Unix, and Linux.

Source to download Composer for Windows:  Composer Download

How to Install Composer in Windows

The easiest way to download the composer is using the installer, though there is an option to download it manually. We will go with the easiest one.

To download the Composer you just download the set-up file from the direct link we provided and follow the steps to complete the installation process.

Step 1: Once the file is downloaded you just run the installation Wizard.

download composer in windows system

Keep the default settings as it is by ignoring the developer mode check box. Hit the next button.

composer next button for installation wizard

Step 2: Now the new popup will come to confirm the PHP command line location. Choose the location as C:/xampp/php/php.exe and hit the next button to continue.

choose the installation location

Step 3: Next popup will confirm the proxy settings. So you may don’t have any idea about the proxy server. Simply skip the step by clicking the next button.

confirm the proxy settings

Step 4: Now you are the final step of installation. The setup will automatically fetch the additional files. Hit the install button to complete.

proceed to composer system install

Step 5: Now the process will take a few seconds to get installed on your device once the process will be completed a confirmation page will be popped up. Click the Finish button to end the process.

finish the composer installation

Step 6: Check the composer is properly working or not. If you are not that expert to use the composer then just have a version check with the simple command-‘ composer –version

check the composer version compatibility for your windows system in command prompt

If you are using the UNIX side wisely with Windows then you can install Composer programmatically. Here we have mentioned a script to run composer on your system.

EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
    >&2 echo 'ERROR: Invalid installer checksum'
    rm composer-setup.php
    exit 1
fi

php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT

Conclusion:-

The above steps are on how to run the composer in your Windows. Now, it’s time for you to install Composer on your appropriate windows operating system. I hope that following the above steps in the article you can install composer as this are the easiest way to set composer in your machine.

See Also…

Get help with File Explorer in Windows 10(Opens in a new browser tab)

How to install and use tree command mac(Opens in a new browser tab)

LEAVE A REPLY

Please enter your comment!
Please enter your name here