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

Ale*_*x L 1 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...
Run Code Online (Sandbox Code Playgroud)

正如您在下面看到的,如果我做作曲家更新,我会遇到类似的问题.

?  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...
Run Code Online (Sandbox Code Playgroud)

有关如何通过这个的任何建议?它在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"
    }
}
}
Run Code Online (Sandbox Code Playgroud)

Nic*_*ich 7

是否启用了zlib扩展?

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

php -m
Run Code Online (Sandbox Code Playgroud)

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

缓存问题?

[...] package information was loaded from the local cache and may be out of date
Run Code Online (Sandbox Code Playgroud)

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

 /Users/alexlongshaw/.composer/cache/
Run Code Online (Sandbox Code Playgroud)

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


代理?

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

https_proxy
http_proxy
HTTPS_PROXY
HTTP_PROXY
Run Code Online (Sandbox Code Playgroud)

常见问题

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

composer diagnose
Run Code Online (Sandbox Code Playgroud)