A
A
adrash kh2018-10-30 16:46:58
ubuntu
adrash kh, 2018-10-30 16:46:58

How to install composer in project folder?

Good evening. I want to install composer in a project. In the project folder, I need to execute the composer require cocur/slugify command, and then composer update and that's it? Am I doing it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad, 2018-10-30
@Result007

If composer is not installed at all, run the following in your project folder

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { 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 you want to install globally so that you do not write this every time, do the following
After that, you can use it. And to install the package, run (provided that it is installed globally, otherwise instead of composer -> php composer.phar)
composer require cocur/slugify
composer update

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question