Last active
April 17, 2023 11:08
-
-
Save vinaydotblog/6896317 to your computer and use it in GitHub Desktop.
Installing composer using curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Goto a directory you can write to: | |
cd ~ | |
#get composer: | |
curl -s https://getcomposer.org/installer | php | |
# move composer into a bin directory you control: | |
sudo mv composer.phar /usr/local/bin/composer | |
# double check composer works | |
composer about | |
# (optional) Update composer: | |
sudo composer self-update |
Usage: php
php -[b|c|n|h|i|q|s|v|?] [] [args...]
Run in LSAPI mode, only '-b', '-s' and '-c' are effective
Run in Command Line Interpreter mode when parameters are specified
-b address:port| Bind Path for external LSAPI Server mode
-c | Look for php.ini file in this directory
-n No php.ini file will be used
-h This help
-i PHP information
-l Syntax check
-q Quiet-mode. Suppress HTTP Header output.
-s Display colour syntax highlighted source.
-v Version number
-? This help
args... Arguments passed to script.
curl: (23) Failure writing output to destination
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
Will failed with error: The installation directory "/usr/local/bin" is not writable. So, need run php with sudo:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer