I'm trying to install Laravel by using the command, "sudo composer create-project laravel/laravel my_project --prefer-dist", but I keep getting the error:
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Network is unreachable
To see if everything was okay, I ran the command, "composer diagnose" and got the following output:
Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri: 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.6.5
PHP version: 7.0.28-0ubuntu0.16.04.1
PHP binary path: /usr/bin/php7.0
And everything apart from the first item is good to go.
Testing the network elements with "curl https://packagist.org/packages.json", the contents of the file is displayed:
{"packages":[],"notify":"\/downloads\/%package%","notify-batch":"\/downloads\/","providers-url":"\/p\/%package%$%hash%.json","search":"\/search.json?q=%query%&type=%type%","provider-includes":{"p\/provider-2013$%hash%.json":{"sha256":"e8a58721d48f09fca4bf257fac28558dc991cef7b48c19788e27bff3a99281d4"},"p\/provider-2014$%hash%.json":{"sha256":"b6bc409a370dc08774a2843e4bbf3361673fc5bc70bed785ebdeda390ba346b3"},"p\/provider-2015$%hash%.json":{"sha256":"a8672ac6b29efa52ebd0cd4e4eb96c501fd53cfe3210f840b16d6e9c94323db4"},"p\/provider-2016$%hash%.json":{"sha256":"71c329389ec4548f58a929bb7247bda62442620297b90cb78436de5782eed151"},"p\/provider-2017$%hash%.json":{"sha256":"b080b76a6d9a2f0894c34e9e49bcfa97a746a45b070e4a6db7703241bf11dd66"},"p\/provider-2017-07$%hash%.json":{"sha256":"070467a6b8731c1ad87e110ebcf4aad74fc772f57ac5fe06a22714732e4d2ec8"},"p\/provider-2017-10$%hash%.json":{"sha256":"9f61c57bba06ec280de49be57bba3f6ce133c2bd1de7252d7e8ff7749519cadf"},"p\/provider-2018-01$%hash%.json":{"sha256":"461f6ba8553b9eb3ca1ffcabcf396c94ca2147b497f2d7db859e85749b2912b5"},"p\/provider-2018-04$%hash%.json":{"sha256":"c7cfb560ab198f3194b37a9acbb2b489a45cf48d269ac388a7b862884ad050d3"},"p\/provider-archived$%hash%.json":{"sha256":"afa373e95aa9fa7678612f8c7a961c6373160760005c1f8f41450f2860d933f9"},"p\/provider-latest$%hash%.json":{"sha256":"df4817874d00dfdd1d46dc2c1d92cd77aac2b9178a2115339e8978ee8652fca7"}}}
Which in theory proves that the network and the server can see the actual file. I've also set via the export command, the HTTP and HTTPS proxies to that of the companies.
I've amended the priority such the IPv4 is higher than IPv6.
Running "composer clearcache" before the commands above makes no difference, neither does changing the repository for the packagist.
Running the command, "curl -sS https://getcomposer.org/installer | php -- --check", once again returns the output of:
All settings correct for using Composer
Does anyone have any other idea as to what I may do to try and get this working? Could it still be a network issue, I'm not sure as to what stream Composer is trying to use.
Thanks for any input given on this problem.