Tutorial – How to install composer to your PHP project

Tutorial - How to install composer to your PHP project


The simplest way is probably to get it via this download link and install it: https://getcomposer.org/Composer-Setup.exe

If you want to install it via command line please dont forget to add composer to PATH, if you’re new to putting variables into PATH, it’s quite easy.
Read about it here: https://hendrikthurau.enterprises/tutorial-how-to-add-system-user-variables-add-to-path-in-environment/

The GIT project can be found here: https://github.com/composer/getcomposer.org/blob/master/web/installer
If you’re using linux you can install via command line.

Installation via command line:

php -r “copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);”
php -r “if (hash_file(‘sha384’, ‘composer-setup.php’) === ’48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5′) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”
php composer-setup.php

php -r “unlink(‘composer-setup.php’);”

That’s it you’re done. Easy, isn’t it?

Leave a Comment

Shopping Cart

Free Instant SEO Audit

[site_audit layout="vertical"]