Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install laravel/socialite using composer behind proxy

I'm using win7x64.

I can install laravel using composer when I'm not behind proxy, but when I'm behind proxy I cannot install anything using composer.

I tried install laravel/socialite I receive error:

The "http://packagist.org/p/provider-2013$64cefc090dc586bcea264a3e17529dfa29b16b 2bf50c52626562f13772982949.json" file could not be downloaded: failed to open st ream: HTTP request failed! http://packagist.org could not be fully loaded, package information was loaded f rom the local cache and may be out of date

[Composer\Downloader\TransportException] The "http://packagist.org/p/laravel/socialite$d9a828b00026fe40a14532c7f93e7 adc78725a74da02a035cd267618876c312a.json" file could not be downloaded: fai led to open stream: HTTP request failed!

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort- packages] [packages1] ... [packagesN]

I have http_proxy and https_proxy env setup.

composer selfupdate is working

but

composer update is not working

Loading composer repositories with package information Updating dependencies (including require-dev) The "http://packagist.org/p/provider-2013$64cefc090dc586bcea264a3e17529dfa29b16b 2bf50c52626562f13772982949.json" file could not be downloaded: failed to open st ream: HTTP request failed! http://packagist.org could not be fully loaded, package information was loaded f rom the local cache and may be out of date Nothing to install or update Generating autoload files Generating optimized class loader

other cli (eg. gem) is working

I have tried this solution

but it still not working

Here are the composer diag stat:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json
" file could not be downloaded: failed to open stream: HTTP request failed!
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe packagist.org is down (The "http://packagi
st.org/packages.json" file could not be downloaded: failed to open stream: HTTP
request failed! )
Checking HTTPS proxy support for request_fulluri: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK

Is there any setup I missed?

like image 852
Arie Agung Avatar asked Oct 20 '22 08:10

Arie Agung


1 Answers

I add this to composer.json

"repositories": [
    {
        "packagist": false
    },
    {
        "type": "composer",
        "url": "https://packagist.org/"
    }
],

This solution is from: https://github.com/composer/composer/issues/1992

like image 187
Arie Agung Avatar answered Oct 30 '22 02:10

Arie Agung