[Composer\Downloader\TransportException]
The "http://packagist.org/packages.json" file could not be downloaded: failed to open stream: HTTP request failed!
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--n
o-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs]
[package] [directory] [version]
The solution is to disable the HTTPS request and use HTTP instead. So we set a local or global composer configuration config in the composer. JSON file
Method 1: command line composer config secure http false. Through the command to modify composer. JSON, the effect is the same as method 2
Method 2: change composer.json directly and add “secure http”: false to “config”
"config" : {
"vendor-dir" : "packages",
"secure-http": false
}
Global configuration (recommended)
composer config -l -g
composer config -g repo.packagist composer
composer config -g --unset repos.packagist
Similar Posts:
- Failed to connect to github.com port 443:connection timed out
- composer platform_check tp6 thinkphp6 laravel Error (PHP Version)
- [Solved] Git Submit Error: (OpenSSL SSL_read: Connection was reset, errno 10054)
- [Solved] Git fatal: unable to access ‘xxx.git/’: Failed to connect to github.com port 443 after ***ms: Timed out
- [Solved] Git submission: gnutls_handshake() failed: Error in the pull function
- fatal: unable to access ‘https://github.com/XXXX.git/’: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
- [Solved] Composer Workerman:Installation failed, reverting ./composer.json to its original content.
- Could not open input file: composer.phar
- [Solved] Github Push Error: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
- [Solved] Unapp H5 Error: Access to XMLHttpRequest at ‘http://www.localtest.com/api/api/v1/job/getPositionList’…