PHP Composer – 无法在macOS Sierra上安装composer

前端之家收集整理的这篇文章主要介绍了PHP Composer – 无法在macOS Sierra上安装composer前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试安装运行getcomposer.org/download文档站点上提供的命令的composer:
PHP -r "copy('https://getcomposer.org/installer','composer-setup.PHP');"
PHP -r "if (hash_file('SHA384','composer-setup.PHP') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.PHP'); } echo PHP_EOL;"
PHP composer-setup.PHP
PHP -r "unlink('composer-setup.PHP');"

但是我收到一条错误消息:

Warning: copy(): SSL operation Failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify Failed in Command line code on line 1

Warning: copy(): Failed to enable crypto in Command line code on line 1

Warning: copy(https://getcomposer.org/installer): Failed to open stream: operation Failed in Command line code on line 1
Yoshihiros-MacBook-Pro:~ yoshihiro$PHP -r "if (hash_file('SHA384','composer-setup.PHP') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.PHP'); } echo PHP_EOL;"

Warning: hash_file(composer-setup.PHP): Failed to open stream: No such file or directory in Command line code on line 1
Installer corrupt
Warning: unlink(composer-setup.PHP): No such file or directory in Command line code on line 1

Yoshihiros-MacBook-Pro:~ yoshihiro$PHP composer-setup.PHP
Could not open input file: composer-setup.PHP

我也试图在全球范围内安装它,但我无法摆脱这个消息.请帮忙D:

我有同样的问题,但这就是我所做的:

>我将其复制粘贴到终端PHP -r“copy(‘http://getcomposer.org/installer’,’composer-setup.PHP’);”在将作曲家下载到您当前所在目录的终端上.

(the problem was causing because of the https protocol)

>然后
PHP composer-setup.PHP –install-dir = /usr/local / bin –filename = composer运行此命令,它将Composer安装到我的bin文件夹,以便我可以全局运行它.
>然后你必须取消链接作曲家PHP -r“unlink(‘composer-setup.PHP’);”
>最后检查一下Composer安装的composer -V.

祝好运 !

原文链接:https://www.f2er.com/php/135681.html

猜你在找的PHP相关文章