Symfony : sonata admin bundle install error - php

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 :)

Related

mpdf can not be installed in laravel 9

i am using laravel 9 and my PhP version is 8.0.2, and I am trying to install Mpdf package, so I write the following command
composer require mpdf/mpdf
but I get this error
Problem 1
- mpdf/mpdf[v8.1.0, ..., v8.1.2] require psr/log ^1.0 || ^2.0 -> found psr/log[1.0.0, ..., 1.1.4, 2.0.0] but the package is fixed to 3.0.0 (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 mpdf/mpdf ^8.1 -> satisfiable by mpdf/mpdf[v8.1.0, v8.1.1, v8.1.2].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
I have tried to delete the vendor and composer.lock and use composer update and it does work
mPDF is not compatible with psr/log 3.x because of support of older PHP versions (which do not have return type hints).
Previously installed Laravel is forcing psr/log library to version 3.x.
You can use flag --with-all-dependencies along with composer require mpdf/mpdf to downgrade the dependency automatically.
Alternatively, downgrade the psr/log library to 2.x - just add or change to "psr/log": "^2.0" line in your composer.json file and run composer update. This will resolve the issue.
Or you can first require mPDF and then Laravel, that should also work. Or require them both in one command.

Failed while installing a package using composer

iam tryin to use a cart package by using this command
composer require jason-napolitano/codeigniter4-cart-module
and it's failed. this is what it said
Using version dev-master for jason-napolitano/codeigniter4-cart-module
./composer.json has been updated
Running composer update jason-napolitano/codeigniter4-cart-module
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires jason-napolitano/codeigniter4-cart-module dev-master -> satisfiable by jason-napolitano/codeigniter4-cart-module[dev-master].
- jason-napolitano/codeigniter4-cart-module dev-master requires codeigniter4/framework ^4.0.3 -> satisfiable by codeigniter4/framework[v4.0.3, ..., v4.1.1] from composer repo (https://repo.packagist.org) but codeigniter4/framework[1.0.0+no-version-set] from root package repo has higher repository priority. The
packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
is it because my minimum-stability in composer.json is set to "stable"?
I presume you created your project by using composer create-project codeigniter4/framework. This effectively created a clean project for you without the .git folder, thus removing any metadata on what version of codeigniter4/framework package you installed. This is indicative by 1.0.0+no-version-set part of the error message.
The jason-napolitano/codeigniter4-cart-module package requires ^4.0.3 version of codeigniter4/framework, but since you have no version metadata in your project, install fails. This can be resolved by setting the version from which you bootstrapped your project manually in your root composer.json:
{
"name": "codeigniter4/framework",
"version": "4.0.3",
...
}
However, this is just a guess, since I have no insight into your main composer.json.
Your PHP is missing intl extension. It is useful for formatting currency, number and date/time as well as UCA-conformant collations, for message formatting and normalizing text..etc.
Check out Codeignitor 4 [Documentation][1]:
Follow the steps to install it in XAMPP -
Open [xampp_folder_path]/php/php.ini to edit.
Search for ;extension=intl and remove the ;.
Save the php.ini file and restart Apache.

Symfony - (1/1) InvalidConfigurationException - Unrecognized option "mailer" under "framework"

I'm quite new at Symfony and struggle with this issue for my internship, when trying to run the project locally :
(1/1) InvalidConfigurationException
In ArrayNode.php line 331:
Unrecognized option "mailer" under "framework". Available options are "annotations", "assets", "cache", [...], "workflows".
I'm running PHP 7.4 and Symfony 4, adapting a symfony project from another dev.
In my .env file, I got swiftmailer bundle, I believe mailer was a different kind of mailer bundle used..?
I tried the following request :
composer require symfony/mailer
And got this :
The "symfony/flex" plugin was skipped because it is not compatible with Composer 2+. Make sure to update it to version 1.9.8 or greater.
Using version ^5.2 for symfony/mailer
./composer.json has been updated
The "symfony/flex" plugin was skipped because it is not compatible with Composer 2+. Make sure to update it to version 1.9.8 or greater.
Running composer update symfony/mailer
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/mailer[v5.2.0, ..., v5.2.2] require symfony/event-dispatcher ^4.4|^5.0 -> found symfony/event-dispatcher[v4.4.0, ..., v4.4.19, v5.0.0, ..., v5.2.2] but the package is fixed to v4.2.8 (lock file version) by a partial up
date and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires symfony/mailer ^5.2 -> satisfiable by symfony/mailer[v5.2.0, v5.2.1, v5.2.2].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Thanks for your help !
If you're kickstarting another dev's project, you probably don't need any composer require. All you have to do is run composer install in project directory to get all the same packages, as previous developer.

how to solve composer minimum-stability

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.

Failing to get package via composer require

I want to user this package hslavich/simplesamlphp-bundle in my project which has dependency on simplesamlphp/simplesamlphp dev-master
If I try to add dependency like this:
composer require hslavich/simplesamlphp-bundle dev-master
I get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for hslavich/simplesamlphp-bundle dev-master -> satisfiable by hslavich/simplesamlphp-bundle[dev-master].
- hslavich/simplesamlphp-bundle dev-master requires simplesamlphp/simplesamlphp dev-master -> no matching package found.
If I git clone the hslavich/SimplesamlphpBundle and use composer update simplesamlphp package is downloaded successfully.
What am I doing wrong?
Add "minimum-stability": "dev" to composer.json. The usage of dev package versions imples that you need to have it. Use
"minimum-stability": "dev",
"prefer-stable" : true
if you don't want it to affect other packages without strict version constraints.

Categories