最近遇到一個問題,一直不知道如何解決,網上搜到很多方法,都沒效果
一開始以為是不支援ssl ,檢查發現是支援的
php -i | grep -i ssl SSL => Yes SSL Version => OpenSSL/1.0.2r core SSL => supported extended SSL => supported openssl OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.0.2r 26 Feb 2019 OpenSSL Header Version => OpenSSL 1.0.2q 20 Nov 2018 Openssl default config => /usr/local/etc/openssl/openssl.cnf openssl.cafile => /usr/local/etc/openssl/cacert.pem => /usr/local/etc/openssl/cacert.pem openssl.capath => /usr/local/etc/openssl => /usr/local/etc/openssl SSL support => enabled OpenSSL support => enabled
登入後複製
後來看有人說要更新ssl 秘鑰
wget http://curl.haxx.se/ca/cacert.pem
登入後複製
然後在php.ini 設定
curl.cainfo=/usr/local/etc/openssl/cacert.pem openssl.cafile=/usr/local/etc/openssl/cacert.pem openssl.capath=/usr/local/etc/openssl
登入後複製
都沒什麼效果,看來並不是因為這些
執行composer diagnose 之後結果
composer diagnose
登入後複製
然後逐個解決錯誤吧,首先是github fail 了,網上google 了下,發現需要設定一個token ,之前怎麼不需要呢,也是奇怪,那先試試
composer config --global github-oauth.github.com <token> or //在composer.json 里加入 "github-oauth":{ "github.com":"{token}" //替换成自己token }</token>
登入後複製
token 生成在https://github. com/settings/t...
執行composer diagnose
Checking composer.json: WARNING require.illuminate/redis : unbound version constraints (*) should be avoided Checking platform settings: OK Checking git settings: OK Checking http connectivity to packagist: OK Checking https connectivity to packagist: OK Checking github.com rate limit: OK Checking disk free space: OK Checking pubkeys: Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642 Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952 OK Checking composer version: OK Composer version: 1.8.4 PHP version: 7.1.19 PHP binary path: /usr/bin/php
登入後複製
搞定!