安装composer的问题

时间:2017-06-21 17:11:53

标签: php macos shell command-line composer-php

我目前正在尝试安装composer以安装laravel。

website instructions之后,我将以下代码输入终端:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { 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

这让我觉得我没有这样做的许可,这是原因,为什么会发生?

2 个答案:

答案 0 :(得分:2)

虽然我无法弄清楚为什么他们的特定代码不起作用。我通过手动安装安装程序来安装composer,而不是依赖于他们网站的请求。

答案 1 :(得分:0)

如果有帮助,您可以使用 http:// 而不是 https

查看更多:https://github.com/composer/composer/issues/5685