Search code snippets, questions, articles...

Install composer for php

php -r "copy('', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

//IF Getting ERROR Please refer
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.

You can run above commands to install composer in your project and get different packages for php. If you are getting error while installing composer by above commands please refer

Was this helpful?