Q&A
質問内容
EC2でLaravelアプリケーションをデプロイしようとcomposer installをすると、以下のような文言が出てインストール作業が完了できずに困っております。
どなたか同様の現象で解決された方、またはアドバイスがあればお力をお借りできないでしょうか。
[ec2-user@ip-10-0-0-100 html]$ composer install No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information. Loading composer repositories with package information https://repo.packagist.org could not be fully loaded (curl error 28 while downloading https://repo.packagist.org/packages.json: Failed to connect to repo.packagist.org port 443 after 5207 ms: Connection timed out), package information was loaded from the local cache and may be out of date In CurlDownloader.php line 377: curl error 28 while downloading https://repo.packagist.org/p2/anhskohbo/no-captcha.json: Failed to connect to repo.packagist.org port 443 after 5206 ms: Connection timed out [ec2-user@ip-10-0-0-100 html]$
前提
・EC2の前にALBが配置されています
・php:8.0.18
・composer: 2.3.7
・インバウンドルール
ソース | タイプ | ポート |
---|---|---|
0.0.0.0/0 | HTTP | 80 |
自宅のIP/32 | SSH | 22 |
・アウトバウンドルール
ソース | タイプ | ポート |
---|---|---|
0.0.0.0/0 | すべてのトラフィック | すべて |
試したこと
■EC2がインターネットと通信できているか確認
[ec2-user@ip-10-0-0-100 html]$ nslookup getcomposer.org Server: 10.0.0.2 Address: 10.0.0.2#53 Non-authoritative answer: Name: getcomposer.org Address: 54.36.53.46 Name: getcomposer.org Address: 2001:41d0:302:1100::8:104f
■curlで直接叩いてみて確認
## ダメ [ec2-user@ip-10-0-0-100 html]$ curl -v https://repo.packagist.org * Trying 51.79.162.48:443... * Trying 2402:1f00:8001:73:::443... * Immediate connect fail for 2402:1f00:8001:73::: Network is unreachable ^C ## ダメ [ec2-user@ip-10-0-0-100 html]$ curl -v http://repo.packagist.org * Trying 51.79.162.48:80... * Trying 2402:1f00:8001:930:::80... * Immediate connect fail for 2402:1f00:8001:930::: Network is unreachable ^C ## いける [ec2-user@ip-10-0-0-100 html]$ curl -v https://www.google.co.jp * Trying 172.217.175.35:443... * Connected to www.google.co.jp (172.217.175.35) port 443 (#0)
■composer diag でコケてる箇所を確認
[ec2-user@ip-10-0-0-100 html]$ composer diag Checking composer.json: WARNING require.aws/aws-sdk-php : unbound version constraints (*) should be avoided Checking platform settings: OK Checking git settings: OK Checking http connectivity to packagist: FAIL [Composer\Downloader\TransportException] curl error 28 while downloading http://repo.packagist.org/packages.json: Failed to connect to repo.packagist.org port 80 after 5207 ms: Connection timed out Checking https connectivity to packagist: FAIL [Composer\Downloader\TransportException] curl error 28 while downloading https://repo.packagist.org/packages.json: Failed to connect to repo.packagist.org port 443 after 5206 ms: Connection timed out Checking github.com rate limit: OK Checking disk free space: OK Checking github.com rate limit: OK Checking disk free space: OK Checking pubkeys: Tags Public Key Fingerprint: XXXX XXXXX XXXX XXXXX Dev Public Key Fingerprint: XXXX XXXXX XXXX XXXXX OK Checking composer version: You are not running the latest stable version, run `composer self-update` to update (2.3.7 => 2.3.8) Composer version: 2.3.7 PHP version: 8.0.18 PHP binary path: /usr/bin/php OpenSSL version: OpenSSL 1.0.2k 26 Jan 2017 cURL version: 7.79.1 libz 1.2.7 ssl OpenSSL/1.0.2k-fips zip: extension present, unzip present, 7-Zip not available
どうぞよろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。