如何在EC2中安装phpspreadsheet使用终端通过已安装的Code igniter中的composer

I am Trying that but, i am getting error again again Error Show Below

[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out

So please any can help me....?

And Composer was installed successfully in over Ec2 Instance Composer version Show Below

Composer version @package_branch_alias_version@ (1.0.0-beta2) 2016-03-27 16:00:34

PHP Version

PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.32-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

CURL -V curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets

I am also trying With Curl Getting Error show Below

curl -sS https://getcomposer.org/installer | php curl: (7) Failed to connect to getcomposer.org port 443: Connection timed out

Thanks