-
-
Save vinaydotblog/6896317 to your computer and use it in GitHub Desktop.
# 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 |
@dimkir, @vinnizworld
Easiest way to download and move file to /usr/local/bin folder.
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer about
Hi All,
I run above command on ubuntu 14, it fails, do you know how to fix this issue on ubuntu?
root@Cmpt2:/tmp# curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
All settings correct for using Composer
Downloading...
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Retrying...
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Retrying...
I was running this on docker alpine container. Was fine and now, all of a sudden its problematic.
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
Now i got this issue```
bash: php: command not found
curl: (23) Failed writing body (0 != 16133)
First install php then try to run this command
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
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
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
I guess it is better to use
curl -sS .... | php
because then you will get the error message in case curl fails. (also error will be sent to stdout thus it won't be sent to php interpreter)Here is info on the related curl command line switches