====== Ошибка Composer The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: Connection timed out ======
Ошибка происходит потому что file_get_contents не может работать с SSL сертефикатами IPv6, лечится очень просто.
Открываем файл **/etc/gai.conf** и заставляем ос работать с IPv4
Для Ubuntu :
precedence ::ffff:0:0/96 100
Для CentOS :
label ::1/128 0
label ::/0 1
label 2002::/16 2
label ::/96 3
label ::ffff:0:0/96 4
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 100