Reputation: 16782
I'm trying to run composer require phpseclib/mcrypt_compat:dev-master
in an empty directory and am getting the following error:
./composer.json has been created
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 phpseclib/mcrypt_compat dev-master -> satisfiable by phpseclib/mcrypt_compat[dev-master].
- phpseclib/mcrypt_compat dev-master requires phpseclib/phpseclib dev-master -> satisfiable by phpseclib/phpseclib[d
ev-master] but these conflict with your requirements or minimum-stability.
Installation failed, deleting ./composer.json.
I do not understand this. https://github.com/phpseclib/phpseclib/blob/master/composer.json says that the minimum required PHP version is 5.6.1. There are two other libs that are required but Composer isn't saying that those other libs are incompatable - Composer is saying phpseclib/phpseclib is incompatable.
Here's the output I get when I type in php -v
:
PHP 7.0.26 (cli) (built: Nov 22 2017 13:19:37) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
PHP 7.0.26 is newer than PHP 5.6.1, the minimumally required version for phpseclib/phpseclib:dev-master.
Any ideas?
Upvotes: 5
Views: 9856
Reputation: 2971
If you created/updated the composer.json as @Devon mentioned to the required version and see this error still, then it means that you forgot to update the composer.lock :
php71 composer.phar update phpseclib/mcrypt_compat --no-progress
Upvotes: 0
Reputation: 1671
I would like to share my experience:
I was creating one bundle and had "minimum-stability": "dev"
in my bundle composer.json file. Then when I added new packages, almost all of them were installed with dev
release.
Later on when I wanted to integrate this bundle into my application, I faced minimum-stability conflict error.
What I did to get rid of this situation:
In my bundle:
"minimum-stability": "dev"
from composer.jsondev
release and composer require
package name` (without specifying any version), this resulted in installing only stable versions.In my application:
Added the local package again with these settings
"repositories": [
{
"type": "path",
"url": "../xyz-auth-bundle"
}
]
"require": {
...
"xyz/auth-bundle": "dev-master"
}
rm -rf var/cache/; composer update;
All went fine.
Some more key points:
application composer.json:
bundle composer.json:
version
specifiedHope this will save someone's time.
Upvotes: 1
Reputation: 35337
Create a composer.json file with minimum-stability specified:
{
"require": {
"phpseclib/mcrypt_compat": "dev-master"
},
"minimum-stability": "dev"
}
http://getcomposer.org/doc/04-schema.md#minimum-stability
The minimum stability defaults to stable if not specified.
Upvotes: 7