I'm new to Symfony and learning on youtube. I want to try annotated routing using sensio/framework-extra-bundle but when I type the composer command to install it I get some errors. I asked GPT and searched on Google to find the solution to the problem but I couldn't find it. What did I do wrong?
When I type this :
composer require sensio/framework-extra-bundle
I'm encoutering with this error :
./composer.json has been updated
Running composer update sensio/framework-extra-bundle
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- sensio/framework-extra-bundle[v2.0.17, ..., v2.0.23] require symfony/framework-b
undle 2.0.* -> found symfony/framework-bundle[2.0.7, ..., v2.0.25] but it conflicts wi
th your root composer.json require (^7.0).
- sensio/framework-extra-bundle[v2.1.0, ..., v2.1.11] require symfony/framework-bu
ndle 2.1.* -> found symfony/framework-bundle[v2.1.0, ..., v2.1.13] but it conflicts wi
th your root composer.json require (^7.0).
- sensio/framework-extra-bundle v2.2.0 requires symfony/framework-bundle 2.2.* ->
found symfony/framework-bundle[v2.2.0, ..., v2.2.11] but it conflicts with your root c
omposer.json require (^7.0).
- sensio/framework-extra-bundle[v2.2.1, ..., v2.3.4] require symfony/framework-bun
dle ~2.2 -> found symfony/framework-bundle[v2.2.0, ..., v2.8.52] but it conflicts with
your root composer.json require (^7.0).
- sensio/framework-extra-bundle v3.0.0 requires symfony/framework-bundle ~2.4 -> f
ound symfony/framework-bundle[v2.4.0, ..., v2.8.52] but it conflicts with your root co
mposer.json require (^7.0).
- sensio/framework-extra-bundle v3.0.1 requires symfony/framework-bundle ~2.5 -> f
ound symfony/framework-bundle[v2.5.0, ..., v2.8.52] but it conflicts with your root co
mposer.json require (^7.0).
- sensio/framework-extra-bundle[v3.0.2, ..., v3.0.10] require symfony/framework-bu
ndle ~2.3 -> found symfony/framework-bundle[v2.3.0, ..., v2.8.52] but it conflicts wit
h your root composer.json require (^7.0).
- sensio/framework-extra-bundle[v3.0.11, ..., v3.0.26] require symfony/framework-b
undle ~2.3|~3.0 -> found symfony/framework-bundle[v2.3.0, ..., v2.8.52, v3.0.0, ..., v
3.4.47] but it conflicts with your root composer.json require (^7.0).
- sensio/framework-extra-bundle v3.0.24 requires symfony/config ^3.2 -> found symf
ony/config[v3.2.0, ..., v3.4.47] but it conflicts with your root composer.json require
(v7.0.4).
- sensio/framework-extra-bundle[v3.0.27, ..., v3.0.29] require symfony/framework-b
undle ~2.3|~3.0|~4.0 -> found symfony/framework-bundle[v2.3.0, ..., v2.8.52, v3.0.0, .
.., v3.4.47, v4.0.0, ..., v4.4.51] but it conflicts with your root composer.json requi
re (^7.0).
- sensio/framework-extra-bundle[v4.0.0, v5.0.0, ..., v5.2.4] require symfony/confi
g ^3.3|^4.0 -> found symfony/config[v3.3.0, ..., v3.4.47, v4.0.0, ..., v4.4.44] but it
conflicts with your root composer.json require (v7.0.4).
- sensio/framework-extra-bundle[v5.3.0, ..., v5.3.1] require symfony/config ^3.4|^
4.2 -> found symfony/config[v3.4.0, ..., v3.4.47, v4.2.0, ..., v4.4.44] but it conflic
ts with your root composer.json require (v7.0.4).
- sensio/framework-extra-bundle[v5.4.0, ..., v5.4.1] require symfony/config ^3.4|^
4.3 -> found symfony/config[v3.4.0, ..., v3.4.47, v4.3.0, ..., v4.4.44] but it conflic
ts with your root composer.json require (v7.0.4).
- sensio/framework-extra-bundle[v5.5.0, ..., v5.5.3] require symfony/config ^4.3|^
5.0 -> found symfony/config[v4.3.0, ..., v4.4.44, v5.0.0, ..., v5.4.36] but it conflic
ts with your root composer.json require (v7.0.4).
- sensio/framework-extra-bundle[v5.5.4, ..., v5.6.1, v6.0.0, ..., v6.1.5] require
symfony/config ^4.4|^5.0 -> found symfony/config[v4.4.0, ..., v4.4.44, v5.0.0, ..., v5
.4.36] but it conflicts with your root composer.json require (v7.0.4).
- sensio/framework-extra-bundle[v6.2.0, ..., v6.2.10] require symfony/config ^4.4|
^5.0|^6.0 -> found symfony/config[v4.4.0, ..., v4.4.44, v5.0.0, ..., v5.4.36, v6.0.0,
..., v6.4.4] but it conflicts with your root composer.json require (v7.0.4).
- Root composer.json requires sensio/framework-extra-bundle * -> satisfiable by se
nsio/framework-extra-bundle[v2.0.17, ..., v2.3.4, v3.0.0, ..., v3.0.29, v4.0.0, v5.0.0
, ..., v5.6.1, v6.0.0, ..., v6.2.10].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals
for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g.
"composer require sensio/framework-extra-bundle:*" to figure out if any version is in
stallable, or "composer require sensio/framework-extra-bundle:^2.1" if you know which
you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
This is my composer.json file :
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "~2.0|^5.0|^6.0|^7.0",
"symfony/dotenv": "7.0.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "^7.0",
"symfony/runtime": "7.0.*",
"symfony/yaml": "7.0.*",
"symfony/config": "v7.0.4"
},
"require-dev": {
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.0.*"
}
}
}
PHP version I use:
PHP 8.3.3 (cli) (built: Feb 13 2024 23:17:12) (ZTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.3.3, Copyright (c) Zend Technologies
composer version:
Composer version 2.7.2 2024-03-11 17:12:18 PHP version 8.3.3 (C:\php\php-8.3.3-Win32-vs16-x64\php.exe) Run the "diagnose" command to get more detailed diagnostics output.
You don't need this Bundle anymore.
Since Symfony 6.2, the SensioFrameworkExtraBundle and Annotations are outdated and no longer recommended to use.
https://symfony.com/bundles/SensioFrameworkExtraBundle/current/index.html
All Annotations are now switched to Attributes.
https://symfony.com/doc/current/reference/attributes.html
If you really want to use annotations, you need to downgrade Symfony itself.