php 未解释为 symfony2 项目 (Akeneo)
Posted
技术标签:
【中文标题】php 未解释为 symfony2 项目 (Akeneo)【英文标题】:php not interpreted into symfony2 project (Akeneo) 【发布时间】:2018-10-27 11:03:15 【问题描述】:我正在尝试安装一个新的 Symfony 2 项目。 一切正常,只有我去首页时,才出现这个(php好像没有被解释):
注销(); $apcLoader->注册(真); */ 要求一次 目录.'/../app/AppKernel.php'; //require_once DIR.'/../app/AppCache.php'; $kernel = new AppKernel('prod', false); $kernel->loadClassCache(); //$kernel = new AppCache($kernel); $request = Request::createFromGlobals(); $响应= $内核->句柄($请求); $响应->发送(); $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"
【问题讨论】:
你能发布你的composer.json吗? @Med 我刚刚添加了它:) @Paul 不要从问题中删除已解决的问题 - 现有答案将失去其上下文。 【参考方案1】:akeneo/pim-community-dev
has lockeddoctrine/orm
到版本2.4.7
。如果您使用composer require doctrine/orm
,composer 将尝试安装doctrine/orm
的最新分支(即^2.6
)。您应该手动为doctrine/orm
指定约束:
composer require "doctrine/orm:^2.4"
但这实际上不会安装任何东西,因为您已经从akeneo/pim-community-dev
安装了doctrine/orm
v2.4.7
。如果您需要更新版本的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
【讨论】:
初学者,如何升级akeneo/pim-community-dev?【参考方案2】:尝试将"akeneo/pim-community-dev": "~1.6.22"
从require
移动到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"
,
【讨论】:
感谢您的回复。我对这个更改有同样的错误。 第二个选项,尝试将最低稳定性更改为dev
?
我更改为“akeneo/pim-community-dev”:“1.4.8”,我有这个错误“PHP 致命错误:允许的 1610612736 字节的内存大小已用尽(试图分配 4096 字节)在 phar:///usr/local/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php 第 52 行"
这是作曲家常见的bug,请阅读getcomposer.org/doc/articles/…,希望对您有所帮助
这个答案不正确 - 将包移动到 require-dev
将永远无法修复此类错误,并且 akeneo/pim-community-dev
不是开发依赖项。以上是关于php 未解释为 symfony2 项目 (Akeneo)的主要内容,如果未能解决你的问题,请参考以下文章
未定义索引:joinColumns 学说 + symfony2
symfony2 重写规则 .htaccess app.php
如何在 symfony2 中将 json 转换为 php 对象?