sS https://getcomposer.org/installer | php
从终点站。我得到这样的输出:
Composer successfully installed to: /Users/kevin/composer.phar
Use it: php composer.phar
Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:
The OpenSSL library (0.9.8zc) used by PHP does not support TLSv1.2 or TLSv1.1.
If possible you should upgrade OpenSSL to version 1.0.1 or above.
然后我试着运行:composer -h
它没有工作,它说command not found。对如何解决这个问题有什么想法吗?
非常感谢。
提前感谢,
凯文正如脚本所说,composer被安装到/Users/kevin/composer.phar
,这意味着它只有在这个目录下才可用。为了使它在任何地方都可用,该文件必须放在/usr/local/bin
文件夹中。
下面的命令将直接安装在那里:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer