Skip to content
← Back to Community
Composer for PHP
Profile icon
FeixuRuins

Is there a way to install PHP libraries via Composer? I've tried installing it but it needs sudo perms. If not, are there plans for it in the future?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
5pengoo
Profile icon
Hong-Ng
Profile icon
d-roch
Profile icon
TorresMBA
Profile icon
Ehnryu
Profile icon
ValKr
Profile icon
word6spelledout
Profile icon
yefoge9955
Profile icon
userfront
Profile icon
FeixuRuins
Comments
hotnewtop
Profile icon
Coder100

Sure, just report to feedback and they'll implement it in the future.

Profile icon
PreknowledgeWeb

Use this trick

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

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

php composer-setup.php

php -r "unlink('composer-setup.php');"

then > php composer.phar composer commands here

Profile icon
rawdreeg

@PreknowledgeWeb thanks for this.

Profile icon
programmeruser

Try using install-pkg to install the composer package.

Profile icon
FeixuRuins

@programmeruser Used that before, no luck.

Profile icon
RYANTADIPARTHI

I don't think there is, maybe if you want this, just give it to the feedback section.