Symfony 更新 2.8 到 3.4

Symfony Update 2.8 to 3.4

我想将我的旧 Symfony 项目从 2.8 升级到 4.0,但我在从 2.8 升级到 3.4 时堆积如山。我使用本教程进行升级 Moving to Symfony 3.4.

我在尝试通过 Composer 进行更新时遇到了一些错误 Composer Upgrade Errors:

# php composer.phar update symfony/symfony --with-dependencies
Dependency "symfony/polyfill-apcu" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "twig/twig" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "ircmaxell/password-compat" is also a root requirement, but is not explicitly whitelisted. Ignoring.
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
    - The requested package symfony/monolog-bundle (installed at v2.12.1, required as ^3.1.0) is satisfiable by symfony/monolog-bundle[v2.12.1] but these conflict with your requirements or minimum-stability.
  Problem 2
    - The requested package sensio/distribution-bundle (installed at v3.0.36, required as ^5.0.19) is satisfiable by sensio/distribution-bundle[v3.0.36] but these conflict with your requirements or minimum-stability.
  Problem 3
    - The requested package sensio/framework-extra-bundle (installed at v3.0.29, required as ^5.0.0) is satisfiable by sensio/framework-extra-bundle[v3.0.29] but these conflict with your requirements or minimum-stability.
  Problem 4
    - The requested package sensio/generator-bundle (installed at v2.5.3, required as ^3.0) is satisfiable by sensio/generator-bundle[v2.5.3] but these conflict with your requirements or minimum-stability.
  Problem 5
    - Conclusion: don't install symfony/symfony v3.4.8
    - Conclusion: don't install symfony/symfony v3.4.7
    - Conclusion: don't install symfony/symfony v3.4.6
    - Conclusion: don't install symfony/symfony v3.4.5
    - Conclusion: don't install symfony/symfony v3.4.4
    - Conclusion: don't install symfony/symfony v3.4.3
    - Conclusion: don't install symfony/symfony v3.4.2
    - Conclusion: don't install symfony/symfony v3.4.1
    - Conclusion: don't install symfony/symfony v3.4.0
    - Conclusion: don't install symfony/symfony v3.3.16
    - Conclusion: don't install symfony/symfony v3.3.15
    - Conclusion: don't install symfony/symfony v3.3.14
    - Conclusion: don't install symfony/symfony v3.3.13
    - Conclusion: don't install symfony/symfony v3.3.12
    - Conclusion: don't install symfony/symfony v3.3.11
    - Conclusion: don't install symfony/symfony v3.3.10
    - Conclusion: don't install symfony/symfony v3.3.9
    - Conclusion: don't install symfony/symfony v3.3.8
    - Conclusion: don't install symfony/symfony v3.3.7
    - Conclusion: don't install symfony/symfony v3.3.6
    - Conclusion: don't install symfony/symfony v3.3.5
    - Conclusion: don't install symfony/symfony v3.3.4
    - Conclusion: don't install symfony/symfony v3.3.3
    - Conclusion: don't install symfony/symfony v3.3.2
    - Conclusion: don't install symfony/symfony v3.3.1
    - Conclusion: don't install symfony/symfony v3.3.0
    - Conclusion: don't install symfony/symfony v3.2.14
    - Conclusion: don't install symfony/symfony v3.2.13
    - Conclusion: don't install symfony/symfony v3.2.12
    - Conclusion: don't install symfony/symfony v3.2.11
    - Conclusion: don't install symfony/symfony v3.2.10
    - Conclusion: don't install symfony/symfony v3.2.9
    - Conclusion: don't install symfony/symfony v3.2.8
    - Conclusion: don't install symfony/symfony v3.2.7
    - Conclusion: don't install symfony/symfony v3.2.6
    - Conclusion: don't install symfony/symfony v3.2.5
    - Conclusion: don't install symfony/symfony v3.2.4
    - Conclusion: don't install symfony/symfony v3.2.3
    - Conclusion: don't install symfony/symfony v3.2.2
    - Conclusion: don't install symfony/symfony v3.2.1
    - Conclusion: don't install symfony/symfony v3.2.0
    - Conclusion: don't install symfony/symfony v3.1.10
    - Conclusion: don't install symfony/symfony v3.1.9
    - Conclusion: don't install symfony/symfony v3.1.8
    - Conclusion: don't install symfony/symfony v3.1.7
    - Conclusion: don't install symfony/symfony v3.1.6
    - Conclusion: don't install symfony/symfony v3.1.5
    - Conclusion: don't install symfony/symfony v3.1.4
    - Conclusion: don't install symfony/symfony v3.1.3
    - Conclusion: don't install symfony/symfony v3.1.2
    - Conclusion: don't install symfony/symfony v3.1.1
    - Conclusion: don't install symfony/symfony v3.1.0
    - Conclusion: don't install symfony/symfony v3.0.9
    - Conclusion: don't install symfony/symfony v3.0.8
    - Conclusion: don't install symfony/symfony v3.0.7
    - Conclusion: don't install symfony/symfony v3.0.6
    - Conclusion: don't install symfony/symfony v3.0.5
    - Conclusion: don't install symfony/symfony v3.0.4
    - Conclusion: don't install symfony/symfony v3.0.3
    - Conclusion: don't install symfony/symfony v3.0.2
    - Installation request for guzzle/guzzle (installed at v3.9.3) -> satisfiable by guzzle/guzzle[v3.9.3].
    - Conclusion: don't install symfony/symfony v3.0.1
    - sensio/framework-extra-bundle v5.1.6 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.5 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.4 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.3 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.2 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.1 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.1.0 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.0.1 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - sensio/framework-extra-bundle v5.0.0 requires symfony/http-kernel ^3.3|^4.0 -> satisfiable by symfony/symfony[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8], symfony/http-kernel[v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8].
    - symfony/http-kernel v3.3.0 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.1 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.10 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.11 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.12 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.13 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.14 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.15 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.16 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.2 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.3 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.4 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.5 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.6 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.7 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.8 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.3.9 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.0 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.1 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.2 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.3 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.4 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.5 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.6 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.7 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v3.4.8 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.0 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.1 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.2 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.3 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.4 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.5 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.6 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.7 conflicts with symfony/symfony[v3.0.0].
    - symfony/http-kernel v4.0.8 conflicts with symfony/symfony[v3.0.0].
    - Installation request for symfony/symfony ~3.0 -> satisfiable by symfony/symfony[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8].
    - Installation request for sensio/framework-extra-bundle ^5.0.0 -> satisfiable by sensio/framework-extra-bundle[v5.0.0, v5.0.1, v5.1.0, v5.1.1, v5.1.2, v5.1.3, v5.1.4, v5.1.5, v5.1.6].

这是我的旧 composer.json:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "minimum-stability": "stable",
    "autoload": {
        "psr-0": {
            "": "src/",
            "SymfonyStandard": "app/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.8.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~3.0",
        "sensio/framework-extra-bundle": "~3.0",
        "incenteev/composer-parameter-handler": "~2.0",
        "facebook/php-sdk-v4": "^5.0",
        "google/apiclient": "1.0.*@beta",
        "ircmaxell/password-compat": "~1.0",
        "symfony/filesystem": "~2.6",
        "symfony/dom-crawler": "~2.6",
        "symfony/yaml": "~2.6",
        "symfony/serializer": "~2.6",
        "omnipay/payu": "^2.0@dev",
        "omnipay/paypal": "^2.5"
    },
    "require-dev": {
        "sensio/generator-bundle": "~2.3"
    },
    "scripts": {
        "post-root-package-install": [
            "SymfonyStandard\Composer::hookRootPackageInstall"
        ],
        "post-install-cmd": [
            "Incenteev\ParameterHandler\ScriptHandler::buildParameters",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles"
        ],
        "post-update-cmd": [
            "Incenteev\ParameterHandler\ScriptHandler::buildParameters",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.5-dev"
        }
    }
}

这是我的新 composer.json:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": {
            "": "src/",
            "SymfonyStandard": "app/"
        }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "~3.0",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "twig/twig": "^1.0||^2.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "^2.6.4",
        "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",
        "symfony/polyfill-apcu": "^1.0",
        "facebook/php-sdk-v4": "^5.0",
        "google/apiclient": "1.0.*@beta",
        "ircmaxell/password-compat": "~1.0",
        "symfony/filesystem": "~2.6",
        "symfony/dom-crawler": "~2.6",
        "symfony/yaml": "~2.6",
        "symfony/serializer": "~2.6",
        "omnipay/payu": "^2.0@dev",
        "omnipay/paypal": "^2.5"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0"
    },
    "scripts": {
        "post-root-package-install": [
            "SymfonyStandard\Composer::hookRootPackageInstall"
        ],
        "post-install-cmd": [
            "Incenteev\ParameterHandler\ScriptHandler::buildParameters",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles"
        ],
        "post-update-cmd": [
            "Incenteev\ParameterHandler\ScriptHandler::buildParameters",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "3.4-dev"
        }
    }
}

老实说,上次我在 3 年前在 Symfony 中做某事,但我真的很想做我的旧项目。如果有人能帮我解决问题。

我已经尝试将 minimum-stability:stable 更改为 minimum-stability:dev 但它没有用。

升级到 3.4.*,因为它是最新的 LTS 版本。更新到版本 4 应该在 4.4 发布时完成(它将是 LTS 版本)。

尝试像下面这样调整您的配置,运行作曲家更新。以下配置带有自动装配。考虑一下你是否想使用它,但我建议,因为通过使用类型提示在构造函数的 services/controllers 中获取你的依赖关系更舒服。

1) Composer.json

"symfony/symfony": "3.4.*",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^5.0.0",
"twig/twig": "^1.0||^2.0",
"symfony/monolog-bundle": "^3.1.0",

2) app/config/services.yml

services:
    _defaults:
        autowire: true # Automatically injects dependencies in your services
        autoconfigure: true
        public: false
        bind:
            # Nice feature here. Local Binding. Read about it at documentation.


    # makes classes in AppBundle available to be used as services
    AppBundle\:
        resource: '../../src/AppBundle/*'
    # exclude directories || files (if service is unused, it will be removed anyway)
        exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
    AppBundle\Controller\:
        resource: '../../src/AppBundle/Controller'
        public: true
        tags: ['controller.service_arguments']

3) AppBundle/Resources/config/services.yml

   services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: false