how to solve composer minimum-stability - php

I'm trying to install Symfony CMF bundle.
I have installed SonataAdminBundle 3.x which requires SonataBlockBundle 3.x.
When installing SymfonyCMF bundle it requires symfoy-cmf/block-bundle 1.x, but this block-bundle requires SonataBlockBundle 2.5 or less.
I have fork the symfoy-cmf/block-bundle 1.x and change the requirement to 3.1 or less.
but I'm still getting following error
Problem 1
- symfony-cmf/block-bundle 1.3.0 requires sonata-project/block-bundle >=2.2.12,<2.5 -> satisfiable by
sonata-project/block-bundle[2.2.12, 2.2.13, 2.2.14, 2.2.15, 2.3.0,
2.3.1, 2.3.10, 2.3.11, 2.3.12, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9] but these conflict with your requirements or minimum-stability.
- symfony-cmf/symfony-cmf 1.3.0 requires symfony-cmf/block-bundle 1.3.* -> satisfiable by
symfony-cmf/block-bundle[1.3.0].
- Installation request for symfony-cmf/symfony-cmf ~1.3 -> satisfiable by symfony-cmf/symfony-cmf[1.3.0].
composar.json
...
"symfony-cmf/symfony-cmf": "~1.3",
"iBasit/block-bundle": "dev-master", // this is to replace sonata-cmf/block-bundle requirement
"sonata-project/block-bundle": "3.0.*",
...

We have got composer dependencies conflict.
I tried to use some ways
use minimum-stability section
use conflict section
install cmf first, before admin bundle
check ways you tried to do
I made all I knew about the area of your question and I dont see any decision right know.
The best way here is to use minimum-stability section to cmf bundle with "prefer-stable": true flag
I strongly not recommend you to make some changes like "I have fork the symfoy-cmf/block-bundle 1.x and change the requirement to 3.1 or less" because in future it can break dependencies and logic of bundles and it''s hardcode.
Thanks for attention, pls let me know if anyone find the decision of the problem.

Related

How to instal phpDocumntor on Symfony4?

I'm trying to install phpDocumentor on my project, but I've got this problem.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpdocumentor/phpdocumentor[v3.1.0, ..., v3.1.2] require symfony/cache ^5.0 -> found symfony/cache[v5.0.0, ..., v5.3.7] but the package is fixed to v4.4.30 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires phpdocumentor/phpdocumentor ^3.1 -> satisfiable by phpdocumentor/phpdocumentor[v3.1.0, v3.1.1, v3.1.2].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
I really don't want to change my Symfony version and I haven't found the way to install the phpDoc on that project :c Do you have any ideas how to install it without changing my project version?
Taking a quick look at the phpDocumentor history, I don't think there's a version that'll be compatible with Symfony 4; they go from Symfony 2 on v2.9 to Symfony 5 on v3.0.
I'm not sure you'd want to tie up your project's requirements with those of an external tool like that, anyway.
I'd suggest using the phar distribution. If you want it included with your project when it's cloned, you can either commit it to the repo or download it with a Composer script on install.

The requested package exists but these are rejected by your constraint

I want to add this tag from the branch 1.x to my project.
I specified: "monolog/monolog": "dev-1.x#1.23.0"
And ran composer update monolog/monolog
Composer says:
Problem 1
- The requested package monolog/monolog dev-1.x#1.23.0 exists as monolog/monolog[1.0.0, 1.0.0-RC1, 1.0.1, 1.0.2, 1.1.0, 1.10.0, 1.11.0, 1.12.0, 1.13.0, 1.13.1, 1.14.0, 1.15.0, 1.16.0, 1.17.0, 1.17.1, 1.17.2, 1.18.0, 1.18.1, 1.18.2, 1.19.0, 1.2.0, 1.2.1, 1.20.0, 1.21.0, 1.22.0, 1.22.1, 1.23.0, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.9.1, 1.x-dev, dev-master, 2.x-dev] but these are rejected by your constraint.
I want to pull specific tag from specific branch. What do I do? this answer suggests I should be ok.
UPDATE:
After following Loek's advise and removing everything before the actual tag I get this:
The requested package monolog/monolog (installed at 1.21.0, required as 1.23.0) is satisfiable by monolog/monolog[1.21.0] but these conflict with your requirements or minimum-stability.
I already have "minimum-stability": "dev" set up.
You can use the composer why-not command to see what packages are conflicting with the version you've specified.
So, without any changes to your composer.json, run:
composer why-not monolog/monolog 1.23.0
This should tell you where the conflict is occurring.
There are also some things you can do to make such conflicts less likely:
Be less strict in your version constraints. Pegging to a specific version of a package gives Composer less freedom to find a working set of packages.
Edit your constraints, and then run composer update without any arguments, to let Composer find the best set of packages that meets those constraints, rather than forcing it to change one package at a time.
I have had the same issue and the problem was on Packagist, I updated the release on Github and it was not updated on Packagist yet. So after updating it there the problem got fixed.
You can just specify the tag you want to download. If the package maintainers tagged their versions well, it doesn't matter on what branch or what stability it is. If you specify 1.23.0, it will always pull in 1.23.0.
EDIT
There is probably some package colliding. Check #IMSoP's answer for an easier way to resolve than mine.
Mine would be: update all the packages and Composer should show what packages are colliding.
I had a similar issue with phpmyadmin after some time keeping intact. version 4.5.0 which I realized was not existing, either deleted or wrongly inputted in past
What seems to help me was manually editing - removing the record from composer.json and issuing composer install command.
The next step was installing one of the concreted versions which was already mentioned like problematic - rejected by constrains 4.7.0 - php7.0 composer install phpmyadmin/phpmyadmin:4.7.0
I had also added along two settings - but those didn't seem to work alone
"minimum-stability": "dev",
"prefer-stable": true,
My original error message was
Problem 1
- The requested package phpmyadmin/phpmyadmin 4.5.0.* exists as phpmyadmin/phpmyadmin[4.0.0, 4.0.1, 4.0.10, 4.0.10.1, 4.0.10.2, 4.0.10.3, 4.0.10.4, 4.0.10.5, 4.0.10.6, 4.0.10.7, 4.0.10.8, 4.0.10.9, 4.0.2, 4.0.3, 4.0.4, 4.0.4.1, 4.0.4.2, 4.0.5, 4.0.6, 4.0.7, 4.0.8, 4.0.9, 4.7.0, 4.7.1, 4.7.2, 4.7.3, 4.7.4, 4.7.5, 4.7.6, 4.7.7, 4.7.8, 4.7.9, 4.7.x-dev, 4.8.0, 4.8.0.1, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.x-dev, 4.9.0, 4.9.0.1, 4.9.1, 4.9.x-dev, 5.0.x-dev, dev-master, 5.1.x-dev] but these are rejected by your constraint.

Symfony : sonata admin bundle install error

I'm trying to install sonata on a new Symfony 3 project.
I follow this installation guide : https://tech.acseo.co/symfony-sonata-admin-tutoriel/ ( dev-master )
I run these commands :
composer require sonata-project/admin-bundle "dev-master"
composer require sonata-project/doctrine-orm-admin-bundle "dev-master"
But I have these errors in my console :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sonata-project/doctrine-orm-admin-bundle dev-master -> satisfiable by sonata-project/doctrine-orm-admin-bundle[dev-master].
- sonata-project/doctrine-orm-admin-bundle dev-master requires php ^5.6 || ^7.0 -> your PHP version (5.6.25) overridden by "config.platform.php" version (5.5.9) does not satisfy that requir
ement.
Installation failed, reverting ./composer.json to its original content.
It's the first time I use sonata, can you help me ?
Thanks you for your response.
Somewhere in your composer.json you have this.
"config": {
"platform": {
"php": "5.5.9"
}
},
This overrides your PHP version and you see this erroryour PHP version (5.6.25) overridden by "config.platform.php" version (5.5.9). Remove it
since Sonata needs PHP > 5.6.
In some cases another trick can help. While you are installing any package by compose you can use --ignore-platform-reqs.
Therefor, you could try
composer require sonata-project/admin-bundle "dev-master" --ignore-platform-reqs
The only problem, that this cheat can break down your dependencies in future, or the bundle you installed use language features of new version, that are incompatible with your minor version.
Using of "--ignore-platform-reqs" - is your consideration.
I've found a solution, I've installed this https://github.com/pierre-vassoilles/symfony2-sonata-base-project
and it works :D
Thank you for your answer :)

Sonata sontauser and fosuser

I am trying to use sonata as my backed. I am now trying to set up some users.
I have installed the fosuserbundle but when I try to get sonata-project/user-bundle I get this:
Problem 1
- sonata-project/user-bundle 2.2.2 requires sonata-project/admin-bundle ~2.2.7 -> no matching package found.
- sonata-project/user-bundle 2.2.1 requires sonata-project/admin-bundle ~2.2.7 -> no matching package found.
- sonata-project/user-bundle 2.2.0 requires sonata-project/admin-bundle ~2.2.7 -> no matching package found.
- Installation request for symfony/framework-standard-edition 2.6.x-dev -> satisfiable by symfony/framework-standard-edition[2.6.x-dev].
- symfony/framework-standard-edition 2.6.x-dev requires sonata-project/user-bundle ~2.2 -> satisfiable by sonata-project/user-bundle[2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4].
- sonata-project/user-bundle 2.2.3 requires friendsofsymfony/user-bundle ~1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev].
- sonata-project/user-bundle 2.2.4 requires friendsofsymfony/user-bundle ~1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev].
- Conclusion: don't install friendsofsymfony/user-bundle 1.3.x-dev
I was looking at the sonata sandbox and in the AppKernel.php they have the following:
// USER
new FOS\UserBundle\FOSUserBundle(),
new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),
I can't find the requirement for FOSUserBundle in their composer file.
Can anyone explain to me what I am doing wrong? I just want to have a simple admin with user management so that I can have something that requires logged in users to access.
Using:
PHP 5.4.36-0+deb7u1 (cli)
Symfony 2.6.3
Thanks
UPDATE
I have followed HypeR suggestion and I now have the correct bundles.
There is a problem with the login. I have created the application bundle and it expects a fos_user_user table. How do I create this??
I try to login and get an error saying that the table fos_user_user does not exist.
You should follow the installation documentation on how to install SonataUserBundle.
To have user management, you need to install FosUserBundle. At the moment Sonata doesn't support the last version of FosUserBundle that's why you have to install the 1.3 version. There is more details about that on this issue.
Then you need to install the 2 dependencies of SonataUserBundle : SonataAdminBundle & SonataEasyExtendsBundle.
Then you can follow the install documentation of SonataUserBundle.
Good luck !
Update
It seems that your database is missing some tables, you should go in the root directory of your project and do in command line :
php app/console doctrine:schema:update --force
You can check the mysql queries that are about to be executed with the --force by using :
php app/console doctrine:schema:update --dump-sql
Check if you did all the steps of the installation of FOSUserBundle 1.3 : https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/doc/index.md

How to integrate Zend_XmlRpc module into Symfony2.1 application?

I need to install Zend_XmlRpc module into my Symfony 2.1 application.
I tried the obvious way using composer.json dependencies:
"require": {
...
"zendframework/zend-xmlrpc": "dev-master"
},
I got the following problems:
- Installation request for zendframework/zend-xmlrpc dev-master -> satisfiable by zendframework/zend-xmlrpc dev-master.
- zendframework/zend-xmlrpc dev-master requires zendframework/zend-http dev-master -> no matching package found.
I'have added the package requirements from the https://packagist.org/packages/zendframework/zend-xmlrpc
"zendframework/zend-http": "dev-master",
"zendframework/zend-math": "dev-master",
"zendframework/zend-server": "dev-master",
"zendframework/zend-stdlib": "dev-master",
"zendframework/zend-xmlrpc": "dev-master"
But now I've got more problems as each of this package has it's own requirements.
My issue is that I have browsed all these requirements and in the end I am ending with installing the "whole" framework.
I get the http package, the loader package, event manager, which I am pretty sure symfony already got them.
Isn't there a way to integrate only the XMLRPC package and maybe bridge the functioanlity with the already existing one from Symfony components?
And if there isn't any solution, how can I force composer to auto install recursively all the required dependencies, as there are many of them, and is weird work to add them manually.
I don't see any reason for use the unstable version of the package.
Instead add
"require": {
...
"zendframework/zend-xmlrpc": "2.1.*"
},

Categories