Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latest Composer version not pulling Laravel

The Latest version of Composer is not pulling Laravel, I thought it could be because of Composer added new secure_http feature for downloading from Packagist and Laravel Packagist are in HTTP. This is what I think, so I need solution. The previous version of Composer doing well. The error showing on my terminal when I was trying to install Laravel installer, is:

Failed to decode response: zlib_decode(): data error Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info Your configuration does not allow connection to http://packagist.org. See https://getcomposer.org/doc/06-config.md#secure-http for details. http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date Installation failed, reverting ./composer.json to its original content. [Composer\Downloader\TransportException] Your configuration does not allow connection to http://packagist.org. See https://getcomposer.org/doc/06-config.md#secure-http for details.

like image 423
Shafiuzzaman Avatar asked Mar 15 '16 05:03

Shafiuzzaman


People also ask

Why is my composer not working?

Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.

How do I update composer to latest version?

update / u / upgrade# In order to get the latest versions of the dependencies and to update the composer. lock file, you should use the update command. This command is also aliased as upgrade as it does the same as upgrade does if you are thinking of apt-get or similar package managers.


3 Answers

I had the same problem. Found the solution here:Reddit Discussion of the issue

Basically, you have two options:

  • Revert to previous version, by running

    self-update --rollback

  • Or, downgrade composer by running

    composer config -g secure-http false

like image 191
adetoola Avatar answered Oct 29 '22 12:10

adetoola


at last this one saved me ,

sudo composer self-update

sudo composer clear-cache

sudo composer config -g secure-http false

sudo composer update --no-scripts

finally done !

like image 45
adnan dogar Avatar answered Oct 29 '22 13:10

adnan dogar


When running (downgrade composer by running)

composer config -g secure-http false

i still got an exeption

Fatal error: Uncaught Error: Call to undefined method Composer\Package\RootPackage::getConfig() ...

I got a success finaly using additional --no-plugins

composer config -g secure-http false --no-plugins
composer self-update --no-plugins

Hope this helps anyone :)

like image 37
Vasil Gerginski Avatar answered Oct 29 '22 13:10

Vasil Gerginski