安装symfony供应商时,Composer会冻结

时间:2013-06-16 22:28:05

标签: symfony composer-php

我正在尝试安装Symfony 2.我遇到的问题是我在没有供应商的情况下下载存档,如果我尝试通过curl安装。

运行OSX / MAMP设置。

➜  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...

如下所示,如果我进行作曲家更新,我会遇到类似的问题。

➜  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...

有关如何解决此问题的任何建议?它在Ubuntu VM上运行正常,所以我认为它与设置有关。

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"
    }
}
}

2 个答案:

答案 0 :(得分:6)

启用了zlib扩展程序?

如果启用或运行zlib(提供zlib_decode),请检查您的phpinfo

php -m

如果你的php cli使用不同的php.ini

缓存问题?

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

删除作曲家的缓存文件夹...

 /Users/alexlongshaw/.composer/cache/

...在您的情况下,仅阻止从缓存更新并查看是否存在常规连接。


<强>代理吗

确保您没有通过环境变量设置代理

https_proxy
http_proxy
HTTPS_PROXY
HTTP_PROXY

常见问题

作曲家具有识别一些常见问题的内在能力

composer diagnose

答案 1 :(得分:0)

这结果与网络有关。在家里没有连接(宽带或3G),但在工作中没有问题