-2

我正在尝试安装一个新的 Symfony 2 项目。一切正常,只有当我进入主页时,才会出现这个(php似乎没有被解释):

注销();$apcLoader->注册(真);*/ require_once DIR .'/../app/AppKernel.php'; //require_once DIR .'/../app/AppCache.php'; $kernel = new AppKernel('prod', false); $kernel->loadClassCache(); //$kernel = new AppCache($kernel); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $响应->发送();$kernel->terminate($request, $response);

当我做一个

composer require symfony/requirements-checker

没有错误。

只有当我做一个

composer require doctrine/orm

出现此错误:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - akeneo/pim-community-dev v1.6.22 requires doctrine/orm 2.4.7 -> satisfiable by doctrine/orm[v2.4.7] but these conflict with your requirements or minimum-stability.
    - akeneo/pim-community-dev v1.6.22 requires doctrine/orm 2.4.7 -> satisfiable by doctrine/orm[v2.4.7] but these conflict with your requirements or minimum-stability.
    - akeneo/pim-community-dev v1.6.22 requires doctrine/orm 2.4.7 -> satisfiable by doctrine/orm[v2.4.7] but these conflict with your requirements or minimum-stability.
    - Installation request for akeneo/pim-community-dev (locked at v1.6.22, required as ~1.6.22) -> satisfiable by akeneo/pim-community-dev[v1.6.22].

我的 composer.json :

{
    "name": "akeneo/pim-community-standard",
    "description": "The \"Akeneo Community Standard Edition\" distribution",
    "license": "OSL-3.0",
    "type": "project",
    "authors": [
        {
            "name": "Akeneo",
            "homepage": "http://www.akeneo.com"
        }
    ],
    "autoload": {
        "psr-0": {
            "": "src/",
            "Context": "features/"
        },
        "psr-4": {
          "Pim\\Upgrade\\": "upgrades/"
        }
    },
    "require": {
        "akeneo/pim-community-dev": "~1.6.22",
        "symfony/requirements-checker": "^1.1"
    },
    "require-dev": {
        "doctrine/migrations": "1.2.2",
        "doctrine/doctrine-migrations-bundle": "1.1.0"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/akeneo/pim-community-dev.git",
            "branch": "master"
        }
    ],
    "scripts": {
        "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",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget",
            "php app/console fos:js-routing:dump --target=web/js/routes.js"
        ],
        "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",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget",
            "php app/console fos:js-routing:dump --target=web/js/routes.js",
            "Pim\\Bundle\\InstallerBundle\\ComposerScripts::copyUpgradesFiles"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "stable",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "keep-outdated": true,
            "file": "app/config/parameters.yml",
            "env-map": {
                "database_host": "PIM_DATABASE_HOST",
                "database_port": "PIM_DATABASE_PORT",
                "database_name": "PIM_DATABASE_NAME",
                "database_user": "PIM_DATABASE_USER",
                "database_password": "PIM_DATABASE_PASSWORD"
            }
        },
        "branch-alias": {
            "dev-master": "1.7.x-dev",
            "dev-1.6": "1.6.x-dev",
            "dev-1.5": "1.5.x-dev",
            "dev-1.4": "1.4.x-dev",
            "dev-1.3": "1.3.x-dev",
            "dev-1.2": "1.2.x-dev",
            "dev-1.1": "1.1.x-dev",
            "dev-1.0": "1.0.x-dev"
        }
    }
}
4

2 回答 2

0

尝试"akeneo/pim-community-dev": "~1.6.22"requireto移动,require_dev因为这会破坏由"minimum-stability": "stable",

"require": {
    "symfony/requirements-checker": "^1.1"
},
"require-dev": {
    "doctrine/migrations": "1.2.2",
    "doctrine/doctrine-migrations-bundle": "1.1.0",
    "akeneo/pim-community-dev": "~1.6.22"
},
于 2018-05-17T08:55:01.730 回答
-1

akeneo/pim-community-dev 已锁定 doctrine/orm版本2.4.7。如果您使用composer require doctrine/ormcomposer 将尝试安装doctrine/orm(即^2.6)的最新分支。doctrine/orm您应该手动指定约束:

composer require "doctrine/orm:^2.4"

但这实际上不会安装任何东西,因为您已经doctrine/orm v2.4.7akeneo/pim-community-dev. 如果您需要更新版本,则doctrine/orm需要升级akeneo/pim-community-dev(或完全删除)。


如果你想升级akeneo/pim-community-dev,你应该从删除多余的依赖开始——它们都已经在akeneo/pim-community-dev包中定义了,所以将它们放在根项目中只会产生冲突。

composer remove doctrine/migrations doctrine/doctrine-migrations-bundle doctrine/orm --dev

然后更新akeneo/pim-community-dev包:

composer require akeneo/pim-community-dev --update-with-dependencies
于 2018-05-17T09:32:54.187 回答