【发布时间】:2017-11-24 17:23:45
【问题描述】:
我目前正在尝试安装 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
这让我觉得我没有权限这样做,这是原因吗?为什么会发生这种情况?
【问题讨论】:
-
当您需要在 Mac 上安装某些东西时,请考虑使用 Homebrew。使用
brew search ***whatever***查看它是否可用。那个包管理器给了我最可靠、可维护的结果。很高兴您找到了解决方法。
标签: php macos shell command-line composer-php