我正在尝试安装运行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');"
Run Code Online (Sandbox Code Playgroud)
但是我收到一条错误消息:
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
Run Code Online (Sandbox Code Playgroud)
我也试图在全球范围内安装它,但我无法摆脱这个消息.请帮助D:
Asi*_*han 19
我有同样的问题,但这就是我所做的:
php -r "copy('http://getcomposer.org/installer', 'composer-setup.php');"上的终端,该终端将作曲家下载到您当前所在的目录.(问题是因为
https protocol)
然后
php composer-setup.php --install-dir=/usr/local/bin --filename=composer运行此命令,将Composer安装到我的bin文件夹,以便我可以全局运行它.
然后你必须取消作曲家的链接 php -r "unlink('composer-setup.php');"
最后检查一下安装的Composer composer -V.
祝好运 !
小智 3
我有同样的问题,但这就是我所做的:
curl -sS https://getcomposer.org/installer | php在我的终端上运行,这使作曲家安装在我的电脑上。mv Composer.phar usr/local/bin/composer。