将现有的 Symfony 项目从 2.8.* 更新到 4.26.3

Posted

技术标签:

【中文标题】将现有的 Symfony 项目从 2.8.* 更新到 4.26.3【英文标题】:Updating an existed Symfony project from 2.8.* to 4.26.3 【发布时间】:2021-11-17 07:30:54 【问题描述】:

我正在尝试更新 composer.json 中现有的 symfony 项目我有以下内容:

 "require": 
    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "^1.3",
    "beberlei/doctrineextensions": "^1.0",
    "liuggio/excelbundle": "^2.1"
,
"require-dev": 
    "sensio/generator-bundle": "~3.0",
    "symfony/phpunit-bridge": "~2.7"
,

然后我把它改成:

  "require": 
    "php": ">=7.4.13",
    "symfony/symfony": "4.26.3",
    "doctrine/orm": "^2.9.5",
    "doctrine/doctrine-bundle": "^2.4.2",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "^3.1.0",
    "sensio/distribution-bundle": "^5.0.19",
    "sensio/framework-extra-bundle": "^5.0.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "^1.3",
    "beberlei/doctrineextensions": "^1.0",
    "liuggio/excelbundle": "^2.1"

,
"require-dev": 
    "sensio/generator-bundle": "~3.0",
    "symfony/phpunit-bridge": "^4.4.2"
,

我已经阅读了那些试图将旧版本更新到最新版本的 symfony 的人的旧答案,但没有任何效果,所以我认为我可能做错了什么。 我什至尝试将其更新到 5.1,但仍然没有结果。这是我在运行 composer install 时遇到的错误:

Problem 1
  - Root composer.json requires symfony/symfony 4.26.3, found symfony/symfony[2.0.4, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev, 6.0.x-dev] but it does not match the constraint.
Problem 2
  - Conclusion: don't install sensio/distribution-bundle v5.0.20 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.3.4 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.3.7 (conflict analysis result)
  - Conclusion: don't install sensio/distribution-bundle v5.0.21 (conflict analysis result)
  - Conclusion: don't install sensio/distribution-bundle v5.0.22 (conflict analysis result)
  - Conclusion: don't install sensio/distribution-bundle v5.0.23 (conflict analysis result)
  - Conclusion: don't install sensio/distribution-bundle v5.0.24 (conflict analysis result)
  - Conclusion: don't install sensio/distribution-bundle v5.0.25 (conflict analysis result)
  - Root composer.json requires doctrine/doctrine-bundle ^2.4.2 -> satisfiable by doctrine/doctrine-bundle[2.4.2].
  - Conclusion: don't install symfony/http-kernel v3.4.39 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v4.4.25 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.40 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v4.4.27 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.41 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v4.4.30 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.42 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.2.7 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.43 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.2.9 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.44 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.2.10 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.45 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.2.12 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.46 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.3.0 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.47 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.3.1 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.48 (conflict analysis result)
  - Conclusion: don't install symfony/doctrine-bridge v5.3.3 (conflict analysis result)
  - Conclusion: don't install symfony/http-kernel v3.4.49 (conflict analysis result)
  - Root composer.json requires sensio/distribution-bundle ^5.0.19 -> satisfiable by sensio/distribution-bundle[v5.0.19, ..., v5.0.25].
  - sensio/distribution-bundle v5.0.19 requires symfony/http-kernel ~2.3|~3.0 -> satisfiable by symfony/http-kernel[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.49].
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.38.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.37.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.36.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.35.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.34.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.33.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.32.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.31.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.30.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.29.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.28.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.27.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.26.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.25.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.24.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.23.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.22.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.21.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.20.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.19.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.18.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.17.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.16.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.15.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.14.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.13.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.4.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.18.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.17.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.16.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.15.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.14.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.13.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.3.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.14.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.13.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.2.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.1.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v3.0.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.52.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.51.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.50.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.49.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.48.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.47.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.46.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.45.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.44.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.43.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.42.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.41.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.40.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.39.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.38.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.37.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.36.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.35.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.34.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.33.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.32.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.31.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.30.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.29.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.28.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.27.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.26.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.25.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.24.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.23.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.22.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.21.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.20.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.19.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.18.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.17.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.16.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.15.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.14.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.13.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.8.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.52.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.51.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.50.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.49.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.48.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.47.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.46.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.45.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.44.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.43.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.42.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.41.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.40.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.39.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.38.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.37.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.36.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.35.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.34.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.33.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.32.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.31.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.30.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.29.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.28.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.27.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.26.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.25.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.24.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.23.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.22.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.21.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.20.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.19.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.18.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.17.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.16.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.15.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.14.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.13.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.7.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.13.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.6.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.5.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.4.0.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.42.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.41.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.40.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.39.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.38.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.37.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.36.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.35.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.34.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.33.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.32.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.31.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.30.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.29.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.28.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.27.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.26.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.25.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.24.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.23.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.22.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.21.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.20.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.19.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.18.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.17.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.16.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.15.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.14.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.13.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.12.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.11.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.10.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.9.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.8.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.7.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.6.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.5.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.4.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.3.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.2.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.1.
  - symfony/doctrine-bridge v4.4.22 conflicts with symfony/http-kernel v2.3.0.
  - doctrine/doctrine-bundle 2.4.2 requires symfony/doctrine-bridge ^4.4.22|^5.2.7|^6.0 -> satisfiable by symfony/doctrine-bridge[v4.4.22, ..., v4.4.30, 
v5.2.7, ..., v5.3.7].
  - Conclusion: don't install symfony/doctrine-bridge v4.4.24 (conflict analysis result)

请我已经为此苦苦挣扎了好几天。任何帮助将不胜感激。

【问题讨论】:

创建一个全新的 4.4 项目,安装您使用过的三个第三方包,并使用生成的 composer.json 文件作为起点。请注意,由于您一直停留在该过程中最简单的部分,因此您不会走得太远。 您尝试过什么解决问题的方法?你被困在哪里了?为什么不逐个检查这个包?例如,symfony/swiftmailer-bundle 与给定的版本约束 ~2.3 安装了四年前的 v2.6.7,与 Symfony 4 不兼容 "但它与约束不匹配。" - 从这个开始。没有像 4.26.x 这样的标签。试试^4.2,和4.2一样。* 【参考方案1】:

几个月前,我从 2.4 -> 2.8 -> 3.4 ->4.4 进行了同样的升级。所以我可以告诉你我是怎么做到的。

建议:

    使用 PHPunit 创建主要路由的冒烟测试基础 按主要版本进行升级,版本上的每个跳转都包含一些弃用,并且假设您是从以前的版本跳转,请阅读更改日志。 SF2.8和SF3.4上使用PHP5.6的版本(这个版本兼容3.0不兼容,直接跳到3.4),不要尝试直接升级到PHP>7.4 3.4升级后,跳转到PHP 7.1,跳过7.0版本 升级 PHP 7.1 后,现在可以升级 SF4.4

PHP 7.2 及以上,包含一些默认不支持的库,所以,这就是使用 PHP 7.1 的原因,那些库是有限的,如果你不使用,你可以更容易地升级。

请记住,即使您可以在 SF4.4 中拥有稳定的 composer.json,SF2.8 中的某些代码使用也是有效的,但在 3.4 或 4.4 上不再适用。在这部分中,我指的是您的应用程序,而不是依赖项。

按此顺序阅读以下课程。

    Upgrade from 2.8 to 3.0 Upgrade from 3 to 4

请记住,最简单的升级方法是使用自动化测试。

【讨论】:

还有什么理由继续使用 PHP 5.6?我目前正在开发一个 Symfony 2.8 项目,在 PHP 7.1 上运行,并且没有不兼容 嗯,基于composer json,SF2.8最常用的版本是PHP5.6,但如果你的项目已经使用7.1也可以,直接升级到SF4即可.4 然后使用 PHP 版本上传到 7.4 我忘记了一些事情,在 composer.json "php": ">=CURRENT_VERSION_USING" 上更改你的 PHP 版本。 2.8 确实在 7.1 上运行良好。我自己还有几个项目。 2.x 从未在 7.4 上测试过。 count 函数的一些相当烦人的“修复”(在 7.2 中引入)肯定会破坏现有代码。顺便说一句,3.4 已经在 7.4 上进行了测试并且工作正常。

以上是关于将现有的 Symfony 项目从 2.8.* 更新到 4.26.3的主要内容,如果未能解决你的问题,请参考以下文章

将现有的objective-c静态库转换为swift

将现有的 iOS 应用项目拆分为静态库和应用皮肤项目

如何将现有的 Android 项目导入 Eclipse?

如何使用 Terraform 将现有的“aws_route53_record”CNAME 更新/修改为 ALIAS

将现有的 Gradle Git 项目导入 Eclipse

将现有的sql添加到django项目中