Composer freezing when installing symfony vendors

 ̄綄美尐妖づ 提交于 2020-01-06 03:20:15

问题


I'm trying to install Symfony 2. I get the same issue of I download the archive without vendors and if I try to install via curl.

Running OSX/MAMP setup.

➜  composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing symfony/icu (v1.0.0)
    Downloading: connection...^C

➜  composer install -vvv
Downloading composer.json
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /Users/alexlongshaw/.composer/cache/repo/https---packagist.org/packages.json into cache
Downloading https://packagist.org/p/provider-active$fa1339d67d333d9449a21f7a2c80888f2c7a02dbb4d3e6b11a9dd5855df3f537.json

....

Downloading http://packagist.org/p/symfony/class-loader$962a39a1da8588e7f97e22517580a460d5349699d5ccb967167c2a1e9802ce50.json
Reading /Users/alexlongshaw/.composer/cache/repo/https---packagist.org/provider-symfony$class-loader.json from cache
zlib_decode(): data error
http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Downloading http://packagist.org/p/symfony/config$eec66e956c41b0728a7fc4f40b95a116bc469f8583c2602b14af3d00f36711fc.json
Writing /Users/alexlongshaw/.composer/cache/repo/https---packagist.org/provider-symfony$config.json into cache


Reading /Users/alexlongshaw/.composer/cache/repo/https---packagist.org/provider-phpoption$phpoption.json from cache
  - Installing symfony/icu (v1.0.0)
Downloading https://api.github.com/repos/symfony/Icu/zipball/v1.0.0
Downloading: connection...

As you can see below, if I do composer update I get a similar problem.

➜  composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
zlib_decode(): data error
http://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
  - Installing symfony/icu (v1.0.0)
    Downloading: connection...

Any suggestions on how to get past this? It works fine for me on an Ubuntu VM so I presume it is something to do with the setup.

Composer.json

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "~2.0"
},
"scripts": {
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
    ],
    "post-update-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
    ]
},
"config": {
    "bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.3-dev"
    }
}
}

回答1:


zlib extension enabled?

check your phpinfo if zlib ( which provides zlib_decode ) is enabled or run

php -m

if your php cli uses a different php.ini

cache problem?

[...] package information was loaded from the local cache and may be out of date

Delete composer's cache folder being...

 /Users/alexlongshaw/.composer/cache/

... in your case to prevent updating from cache only and see if a general connection exists.


proxy?

make sure you don't have a proxy set via environment-variables

https_proxy
http_proxy
HTTPS_PROXY
HTTP_PROXY

common problems

composer has built-in capabability of identifying some common problems

composer diagnose



回答2:


This turned out to be network related. Didn't work on either connection (Broadband or 3G) at home but at work there were no problems



来源:https://stackoverflow.com/questions/17138319/composer-freezing-when-installing-symfony-vendors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!