Search code examples
jsoncomposer-phphamcrest

Composer hanging while updating dependencies


I tried updating a Laravel project I'm working on today using composer update

But it hung on Updating dependencies (including require-dev)

So I tried things like updating composer, dump-autoload, but nothing seemed to work. Then I ran it in verbose mode: composer update -vvv

And I noticed it hung while reading this json:

Reading path/to/Composer/repo/https---packagist.org/provider-cordoval$hamcrest-php.json from cache

I tried searching for cordoval/hamcrest-php on packagist.org and couldn't find it. This isn't listed as a dependency in my composer.json

Searching through my vendor folder, I notice the mockery/mockery package I use requires hamcrest/hamcrest-php, but I can't find anything that makes any reference to cordoval.

Any idea what's wrong and how I can fix it so that I can do the update?

Here's my composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.2.*",
        "iron-io/iron_mq": "dev-master",
        "phpunit/phpunit": "4.2.*",
        "mockery/mockery": "dev-master",
        "xethron/migrations-generator": "dev-master",
        "mailgun/mailgun-php": "dev-master"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

Update

I've tried removing some of the packages from my composer.json, including the "mockery/mockery" package. The only change it made was that Composer would hang on a different file.

After leaving Composer running like that for quite a long time, it finally exited with an error such as the following:

/path/to/ComposerSetup/bin/composer: line 18:  1356 Segmentation fault      php "${dir}/composer.phar" $*

Not sure what to do about that...


Solution

  • So it turns out the problem was with php's xdebug extension. After disabling it in my php.ini, composer ran without any problems.

    And just to note, the hang-up wasn't actually occurring while reading files from the cache. It was the step right after where composer was trying to resolve dependencies. It just never finished that step and never printed the output. That's why no matter what I did, it always appeared to be stuck reading a file from the cache.