Extremely slow and inconsistent composer

Asked

Viewed 2,171 times

1

A few days ago I’m having a problem in my Composer that doesn’t make much sense (it doesn’t have a fault/standard logic, the errors are almost random), so I’m not able to solve, what happens is the following.

I have a mini framework, and I am updating it as I need the resources, the steps are as follows:

1 - Changing the framework.

2 - I push on github.

3 - I upgrade packagist.

4 - I update the composer in the project I’m using it (At this stage is the problem)

If I indicate to update only the dependency in question, it works correctly, however, if I give the command 'composer update' it removes some dependencies (all the time) and installs again, and on top of that does not update the autoloader if the folder 'vendor/composer' is not deleted, and to complicate, this process of the update command is taking more than 20 minutes, and originating several alerts like this.

exceeded the timeout of 300 seconds.

But, this update of dependencies are not consistent, IE, are not the same that always update, each time is a different.

NOTE:I checked the repository of the dependencies that update, and most have no change in github/gitlab but still the composer identifies that the version I own is different from the version available.

List of dependencies that require updating without being modified more frequently:

Phpdocumentor (This is the one that takes the longest and updates are inconsistent)

Synfony

Doctrine

Guzzlehttp

robinherbots/jquery.inputmask (This updates 100% of the time and takes too long)

cocur/slugify

Components/jquery

zendframework

And when each of these dependencies have other dependencies, they are also updated 100%, taking a long time to complete, when it does not alert errors and/or does not conclude.

And the second problem is the issue of updating the autoload inside vendor.

If the file composer.json is updated to include some namespace new, and if given command update, it does the whole process, indicates success, but does not include the new namespace in the autoload, for this step to work, I need to delete the folder 'vendor/composer' give command 'composer update' and wait +- 20 minutes(already reached more than 40) to update everything and I can go back to work.

Additional information:

Test: Ubuntu OS 16.4

Production: Debian OS 7.

PHP: 7. GIT: Last Version.

Permissions for 777 folders.

IDE: Netbeans 8.2

Internet Broadband 50MB Stable.

Composer.json

  {
    "name": "contabil app center",
    "description": "",
    "type": "Biblioteca",
    "license": "BSD-3",
    "version": "1.0",
    "authors": [
        {
            "name": "Gabriel",
            "email": ""
        }
    ],
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.3.8",  
        "guzzlehttp/guzzle": "~6.0",
        "slim/pdo": "~1.9",
        "cocur/slugify": "dev-master",
        "components/jquery": "~3.2.1",
        "wixel/gump": "dev-master",
        "phpmailer/phpmailer": "^5.2",
        "easy-cont/vidb": "dev-master",
        "phpdocumentor/phpdocumentor": "2.*"
    },
    "autoload": {
        "psr-4": {

            "appModel\\": "model/app",
            "appView\\": "view/app",
            "appController\\": "controller/app",
            "appFinancialRestatement\\":"model/app/calculations/financial-calculations",
            "appFinancialIndices\\":"model/app/calculations/financial-calculations",
            "appDebitWorksheet\\":"model/app/calculations/financial-calculations",
            "appFIPE\\":"model/app/fipe",
            "phpToJs\\":"interactors",
            "siteModel\\": "model/site",
            "indexView\\": "view/site",
            "siteController\\": "controller/site"
        }
    }
}
  • Play your composer.json for us to see what may be happening. But, parenting may be some mistake in your Composer. Which version of it?

  • I added Composer.json at the end of the reply, I’m using the latest version, if I’m not mistaken it’s 1.5.1.

1 answer

1


Possible causes of error:

1. Problems on the network:

As the question below can be a problem with IPV6, by chance it is Linux, I do not know if the problem occurs in Windows:

It can also be a problem with the Firewall or Proxy on the network, one of these two not have to formulate a "standard" answer, because each network can work in a way.

2. Xdebug or similar active on the CLI

Composer is PHP in CLI (command line interface), using Xdebug on it or similar extensions can cause problems of type, I recommend creating a php.ini for CLI and another for Apache (if linux is already separated) and then on php.ini to CLI just comment on the line of all possible extensions you use to debug as I explained in this reply:

3. Outdated composer

Could be a bug in the version of composer, or maybe that’s how it worked in older versions, downloading everything again, in case you can first check the current version of Composer with the command:

composer -V

Note: the V is in capital letters

Or the command:

composer -about

The most current version is the 1.5.1, if it is less than this it is necessary to update, for this use the command:

composer self-update

If the command does not work it is because it really must be using a very old version, then you will only be able to update manually, being Linux I can’t say where it was installed because it is the option of the machine user, if you know where the file is composer.phar remove it and install again:

Download the setup:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

And then run the setup:

php composer-setup.php

Installing Globally on Linux

In linux Composer is not installed globally, but can copy move manually, after downloading can do this as the response of Wallace:

chmod +x composer.phar
mv composer.phar /usr/local/bin/composer

Or according to the answer Daniel edit the .bashrc and add:

alias composer=/a/pasta/onde/esta/conposer.phar

Browser other questions tagged

You are not signed in. Login or sign up in order to post.