cross dependencies in composer require - php

Im trying to require phpunit/dbunit.
I run the command php composer.phar require phpunit/dbunit which apparently requires symfony/yaml ^3.0.
My problem is I already have a vendor library that uses symfony/yaml v2.8.33.
Here is the composer log:
Installation request for phpunit/dbunit 3.0.0 -> satisfiable by phpunit/dbunit[3.0.0].
- Conclusion: remove symfony/yaml v2.8.33
- Conclusion: don't install symfony/yaml v2.8.33
- phpunit/dbunit 3.0.0 requires symfony/yaml ^3.0
My issue is if i install symfony/yaml ^3.0 wont this break my existing dependency that is using symfony/yaml v2.8.33.
I want the latest version of phpunit/dbunit so installing an earlier version is not really what I'm seeking.
How do I proceed?

If the phpunit package explicitly requires a version of a package which you explicitly installed in another version, there is no real good solution. You could try to update your code to use Symfony 3.0, as this should be the same as 2.8 without deprecation notices, and then installing dbunit should be possible.

Related

facing issue while installing composer require asm/php-ansible with laravel

I am executing below command
composer require asm/php-ansible
I am getting below out put
- Can only install one of: symfony/process[v3.4.8, v4.1.0].
- Can only install one of: symfony/process[v3.4.9, v4.1.0].
- Installation request for symfony/process (locked at v4.1.0) -> satisfiable by symfony/process[v4.1.0].
I have checked my symfony/process version. It shows me v4.1.0.
The problem is that asm/php-ansible has old versions of symfony/process defined in it's dependencies: "~2.6|~3.0"
Please refer here:
https://github.com/maschmann/php-ansible/blob/master/composer.json#L16
You have two options now:
1) Create an issue (from here: https://github.com/maschmann/php-ansible/issues), raising the questing if it's possible that they update their symfony/process dependency to accept versions ~4.0 and wait for them to resolve it.
or
2) Downgrade the package which depends on symfony/process. I guess that's not a very good option. But if you decide to go that road, you should first check which package depends on this. You can do this via this command:
composer depends symfony/process
My guess is that it's the laravel/framework in your case.

How to find conflicting composer package?

I'm trying to update PHPUnit version on a project I'm going to create based on Cilex. It has PHPUnit version ~3.7. When I run composer require phpunit/phpunit:~6 --dev it prints out:
Problem 1
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- phpunit/phpunit 6.3.0 requires phpunit/php-code-coverage ^5.2.2 -> satisfiable by phpunit/php-code-coverage[5.2.2].
- Installation request for phpunit/phpunit ^6.3 -> satisfiable by phpunit/phpunit[6.3.0].
- Installation request for phpunit/php-code-coverage (locked at 1.2.18) -> satisfiable by phpunit/php-code-coverage[1.2.18].
However it won't say which package is the offending one. The composer file is this one.
PS:
Also, I ran composer require php:~7.1 just in case, and it worked, but updating PHPUnit after that still doesn't work.
Require package with --update-with-dependencies
Run
$ composer require phpunit/phpunit:^6.0.0 --update-with-dependencies
to update phpunit/phpunit while updating its dependencies at the same time.
See https://getcomposer.org/doc/03-cli.md#require:
--update-with-dependencies: Also update dependencies of the newly required packages.
List reasons
If this doesn't help, run
$ composer why-not phpunit/phpunit:^6.0.0
to list reasons why the package could not be installed.

How to identify what is preventing Composer from installing latest version of a package?

I'm using the Composer Dependency Manager for PHP and it won't install the latest version of a package. How can I identify what is holding back composer from installing the latest version?
For example, I have symfony/console in the composer.json versioned as:
"symfony/console": "~3.1",
If I run composer outdated it shows I have symfony/console version 3.1.4 installed, and that version 3.3.5 is available and semver-compatible.
$ composer outdated --no-ansi
symfony/console v3.1.4 ! v3.3.5 Symfony Console Component
However, if I perform a dry-run of the update, it will only being me up as far as version 3.2.12.
$ composer update --dry-run --with-dependencies symfony/console
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 2 updates, 0 removals
- Updating symfony/polyfill-mbstring (v1.2.0) to symfony/polyfill-mbstring (v1.4.0)
- Installing psr/log (1.0.2)
- Installing symfony/debug (v3.3.5)
- Updating symfony/console (v3.1.4) to symfony/console (v3.2.12)
How can I identify what is holding symfony/console back at version 3.2.12 when 3.3.5 is the latest?
The prohibits or why-not command will show what is blocking a version.
$ composer prohibits symfony/console 3.3.5
symfony/console v3.3.5 conflicts symfony/dependency-injection (<3.3)
Documentation here.

FOSREST Bundle conflict with SensioFrameworkExtraBundle

Hi my application is running with Symfony2.7.15 which contains new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle() in AppKarnel.php as well.
Now we need to make a Restful API to user webservices. I am trying to install FOSRESTBundle for this purpose but I am getting the following error.
friendsofsymfony/rest-bundle 1.8.0 conflicts with sensio/framework-extra-bundle[v3.0.16].
- friendsofsymfony/rest-bundle 1.8.0 conflicts with sensio/framework-extra-bundle[v3.0.16].
- friendsofsymfony/rest-bundle 1.8.0 conflicts with sensio/framework-extra-bundle[v3.0.16].
- Installation request for friendsofsymfony/rest-bundle ^1.8 -> satisfiable by friendsofsymfony/rest-bundle[1.8.0].
- Installation request for sensio/framework-extra-bundle (locked at v3.0.16, required as ^3.0.2) -> satisfiable by sensio/framework-extra-bundle[v3.0.16].
Please suggest how to resolved this.
According to packagist page of friendsofsymfony/rest-bundle the version 1.8.0 that you are installing conflicts with sensio/framework-extra-bundle: >=3.0.13
You have two choices here:
Downgrade sensio/framework-extra-bundle to the first non-conflicting version:
$ composer require sensio/framework-extra-bundle "3.0.12"
Install more recent version of friendsofsymfony/rest-bundle that is compatible with the extra bundle >=3.0.13:
$ composer require friendsofsymfony/rest-bundle "2.0.0"
As far as I can see the newer version is still compatible with Symfony 2.7+ so I would give it a shot.
Check the version of
sensio/framework-extra-bundle
I assume,It's 3.0.16
And FOSRestBundle requires framework-extra-bundle to be 3.0.2,
Update extra-bundle too. This should solve the problem.
I had same problem and just solved it.
FOSRestBundle v1.8.0 conflicts with sensio/framework-extra-bundle v3.0.13 or higher. Mentioned here, https://packagist.org/packages/friendsofsymfony/rest-bundle#1.8.0
Yours is v3.0.16 which is in the conflict range.
Here is the way how you can solve it:
Install FOSRestBundle v2.0.0, which only conflicts with sensio/framework-extra-bundle v3.0.13 or lower versions. So, your v3.0.16 is fine. More details: https://packagist.org/packages/friendsofsymfony/rest-bundle#2.0.0
I resolved it by running these two commands,
$ composer require sensio/framework-extra-bundle "3.0.12"
$ composer require friendsofsymfony/rest-bundle 1.8

upgrading yii2 advanced from 2.0.6 to 2.0.7 does not work

In my project directory I first executed the following two commands
php C:\ProgramData\ComposerSetup\bin\composer.phar self-update
php C:\ProgramData\ComposerSetup\bin\composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
But executing the command
composer require yiisoft/yii2 2.0.5
yields:
Your version of PHP, 5.4.7, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for yiisoft/yii2 2.0.7 -> satisfiable by yiisoft/yii2[2.0.7].
- Conclusion: remove bower-asset/jquery.inputmask 3.1.63
- Conclusion: don't install bower-asset/jquery.inputmask 3.1.63
- yiisoft/yii2 2.0.7 requires bower-asset/jquery.inputmask ~3.2.2 -> satisfiable by bower-asset/jquery.inputmask[3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.7].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.6].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.5].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.4].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.3].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.2].
- Installation request for bower-asset/jquery.inputmask (locked at 3.1.63) -> satisfiable by bower-asset/jquery.inputmask[3.1.63].
Installation failed, reverting ./composer.json to its original content.
Any help?
Upgrade from Yii 2.0.6 to Yii 2.0.7, Pls visit this link
Added new requirement: ICU Data version >= 49.1. Please, ensure that your environment has ICU data installed and up to date to prevent unexpected behavior or crashes. This may not be the case on older systems e.g. running Debian Wheezy.

Categories