php - composer不知什么原因,遇到https,就会报SSL: Handshake timed out,Google也没结果
本文介绍了php - composer不知什么原因,遇到https,就会报SSL: Handshake timed out,Google也没结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL: Handshake timed out
执行: composer diagnose检查显示
[root@iZm5e5k2yby7w6yyixdif3Z .composer]# composer diagnose
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: WARNING
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL: Handshake timed out
Failed to enable crypto
failed to open stream: operation failed
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" file could not be downloaded: SSL: Handshake timed out
Failed to enable crypto
failed to open stream: operation failed
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
ssing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/versions" file could not be downloaded: SSL: Handshake timed out
Failed to enable crypto
failed to open stream: operation failed
diagnose
执行
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
显示
PHP Warning: copy(): SSL: Handshake timed out in Command line code on line 1
PHP Warning: copy(): Failed to enable crypto in Command line code on line 1
PHP Warning: copy(https://install.phpcomposer.com/installer): failed to open stream: operation failed in Command line code on line 1
解决方案
打开php.ini, 将default_socket_timeout值调大。如:default_socket_timeout=360(默认为-1或60)
这篇关于php - composer不知什么原因,遇到https,就会报SSL: Handshake timed out,Google也没结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文