Can't install RabbitMQ Symfony - php

i'm trying to install into my project RabbitMq bundle
i use php7.4.9
i can install rabbitMQ server on Ubuntu, but now i have problem with Symfony
and I also wanted to ask, suddenly you came across a good example in OOP, I want to make good code
tanyaPC: composer require php-amqplib/rabbitmq-bundle
Using version ^1.14 for php-amqplib/rabbitmq-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.
Problem 1
- php-amqplib/rabbitmq-bundle v1.14.4 requires symfony/dependency-injection ^2.7|^3.0|^4.0 -> no matching package found.
- php-amqplib/rabbitmq-bundle v1.14.3 requires symfony/dependency-injection ^2.7|^3.0|^4.0 -> no matching package found.
- php-amqplib/rabbitmq-bundle v1.14.2 requires symfony/dependency-injection ^2.7|^3.0|^4.0 -> no matching package found.
- php-amqplib/rabbitmq-bundle v1.14.1 requires symfony/dependency-injection ^2.7|^3.0|^4.0 -> no matching package found.
- php-amqplib/rabbitmq-bundle v1.14.0 requires symfony/dependency-injection ^2.7|^3.0|^4.0 -> no matching package found.
- Installation request for php-amqplib/rabbitmq-bundle ^1.14 -> satisfiable by php-amqplib/rabbitmq-bundle[v1.14.0, v1.14.1, v1.14.2, v1.14.3, v1.14.4].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
i'm trying found resolve this problem in internet, but i didnt found, i really hope, that you can help me
this is my composer.json
{
"type": "project",
"license": "proprietary",
"require": {
"php": ">=7.2.5",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11",
"doctrine/annotations": "^1.11",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.7",
"php-amqplib/php-amqplib": "^2.12",
"symfony/console": "5.1.*",
"symfony/dotenv": "5.1.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.1.*",
"symfony/framework-bundle": "5.1.*",
"symfony/security-bundle": "5.1.*",
"symfony/twig-bundle": "5.1.*",
"symfony/validator": "5.1.*",
"symfony/yaml": "5.1.*"
},
"require-dev": {
"symfony/maker-bundle": "^1.23",
"symfony/stopwatch": "^5.1",
"symfony/web-profiler-bundle": "^5.1"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"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": "5.1.*"
}
}
}

Problem
It says it
requires symfony/dependency-injection ^2.7|^3.0|^4.0
but at the same time you have
Restricting packages listed in "symfony/symfony" to "5.1.*"
so it will not be compatible.
Possible Solution 1
You make all the Symfony stuff "old", something like
"symfony/console": "^4.4.0|^5.0.0|^5.1.0",
...
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.4.*"
}
}
(can probably be optimized), this might work.
Possible Solution 2
Since the bundle hasn't been updated in a while and you are using a new version of Symfony, a better way might be to use the symfony/messenger.

Related

phpinfo() shows opcache.blacklist_filename file, but contents ignored

In my Symfony/Sonata application's php.ini file, I have opcache.blacklist_filename set to /usr/src/app/config/opcache-exclude.txt. In a phpinfo() call on my test server, that file shows up in the correct place. Here is the content of the file:
/usr/src/app/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/SonataAdminBundle.php
/usr/src/app/vendor/symfony/security-core/Authorization/TraceableAccessDecisionManager.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/*/*.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/*/*/*.php
/usr/src/app/vendor/sonata-project/core-bundle/src/CoreBundle/SonataCoreBundle.php
/usr/src/app/vendor/sonata-project/core-bundle/src/*/*.php
/usr/src/app/vendor/sonata-project/core-bundle/src/*/*/*.php
/usr/src/app/vendor/symfony/security-core/Authorization/*
However, when I load my Sonata application, I still get this error, which is the same error that shows up when no blacklist is used:
Fatal error: Cannot redeclare twig_truncate_filter() (previously declared in vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php:38)
Am I using the wrong format in my exclusion file? How can I fix this so that the file's contents do not get ignored?
====
Update #1: When I simplify the contents of the blacklist file to this:
/usr/src/app/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php
/usr/src/app/vendor/sonata-project/admin-bundle/src/SonataAdminBundle.php
/usr/src/app/vendor/symfony/security-core/Authorization/TraceableAccessDecisionManager.php
... I still get essentially the same error:
Compile Error: Cannot declare class Twig_Extensions_Extension_Text,
because the name is already in use in Text.php line 15
(Yes, this is technically a different error, but it's essentially saying the same thing: The contents of Text.php are already declared in the opcache and cannot be redeclared.)
====
Update #2: Running php -v shows 7.4.19 as the version. Here is a bit of version info that shows up when I use composer info:
twig/extra-bundle v3.3.1
twig/twig v2.12.2
Running composer why twig/twig shows this output:
app-insights-php/app-insights-php-bundle 0.2.5 requires twig/twig (^1.2|^2)
friendsofsymfony/user-bundle v2.1.2 requires twig/twig (^1.28 || ^2.0)
sonata-project/admin-bundle 3.55.0 requires twig/twig (^2.10)
sonata-project/block-bundle 3.18.2 requires twig/twig (^1.34 || ^2.0)
sonata-project/core-bundle 3.17.2 requires twig/twig (^1.34 || ^2.0)
sonata-project/formatter-bundle 4.1.3 requires twig/twig (^2.4)
sonata-project/media-bundle 3.21.0 requires twig/twig (^2.10)
sonata-project/page-bundle 3.13.0 requires twig/twig (^2.10)
sonata-project/seo-bundle 2.9.0 requires twig/twig (^1.40 || ^2.9 || ^3.0)
sonata-project/translation-bundle 2.5.0 requires twig/twig (^2.12)
sonata-project/user-bundle 5.x-dev requires twig/twig (^2.9)
symfony-cmf/routing-bundle 2.1.1 requires twig/twig (^1.35 || ^2.4.4)
symfony/twig-bridge v4.4.16 requires twig/twig (^1.41|^2.10|^3.0)
symfony/twig-bundle v4.4.16 requires twig/twig (^1.41|^2.10|^3.0)
symfony/web-profiler-bundle v4.4.16 requires twig/twig (^1.41|^2.10|^3.0)
twig/extensions v1.5.4 requires twig/twig (^1.27|^2.0)
twig/extra-bundle v3.3.1 requires twig/twig (^2.4|^3.0)
====
Edit #3: There is no use of include_once() or require_once() in this app, beyond the normal autoloaders and configuration loaders found in many Symfony applications. This problem goes away when opcache is turned off. So it's definitely related to opcaching.
====
Edit #4: Here is my composer.json file.
{
"type": "project",
"license": "proprietary",
"name": "exozet/oesterreich-werbung-cms",
"description": "the new cms for Österreich Werbung based on symfony with sonata",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-curl": "*",
"ext-iconv": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-simplexml": "*",
"ext-zip": "*",
"ext-zend-opcache": "*",
"app-insights-php/app-insights-php-bundle": "^0.2.5",
"app-insights-php/doctrine-dependency-logger": "^0.2.0",
"cocur/slugify": "^3.2",
"dracoblue/craur": "^2.1",
"elao/enum": "^1.7",
"friendsofsymfony/elastica-bundle": "^5.1",
"friendsofsymfony/rest-bundle": "^2.5",
"friendsofsymfony/user-bundle": "^2.0",
"galbar/jsonpath": "^1.0",
"guzzlehttp/guzzle": "6.3.3",
"jms/serializer-bundle": "3.8.0",
"knplabs/knp-gaufrette-bundle": "^0.6.1",
"knplabs/knp-menu-bundle": "^2.0",
"lightsaml/sp-bundle": "^1.2",
"madcoda/php-youtube-api": "^1.2",
"microsoft/azure-storage-blob": "^1.4",
"microsoft/azure-storage-file": "^1.2",
"microsoft/azure-storage-queue": "^1.3",
"microsoft/azure-storage-table": "^1.1",
"nelmio/api-doc-bundle": "^4.3",
"predis/predis": "^1.1",
"sensio/framework-extra-bundle": "^5.1",
"sonata-project/admin-bundle": "^3.20",
"sonata-project/datagrid-bundle": "^2.0",
"sonata-project/doctrine-orm-admin-bundle": "^3.10",
"sonata-project/formatter-bundle": "^4.1",
"sonata-project/media-bundle": "^3.2",
"sonata-project/page-bundle": "^3.12",
"sonata-project/translation-bundle": "^2.5",
"sonata-project/user-bundle": "dev-master",
"stof/doctrine-extensions-bundle": "^1.4",
"symfony/asset": "4.4.*",
"symfony/console": "4.4.*",
"symfony/dotenv": "4.4.*",
"symfony/expression-language": "4.4.*",
"symfony/flex": "^1.3.1",
"symfony/form": "4.4.*",
"symfony/framework-bundle": "4.4.*",
"symfony/http-client": "4.4.*",
"symfony/intl": "4.4.*",
"symfony/lock": "4.4.*",
"symfony/messenger": "4.4.*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "4.4.*",
"symfony/security-bundle": "4.4.*",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/translation": "4.4.*",
"symfony/twig-bundle": "4.4.*",
"symfony/validator": "4.4.*",
"symfony/web-link": "4.4.*",
"symfony/yaml": "4.4.*",
"twig/extra-bundle": "^3.3",
"webmozart/assert": "^1.5"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.2",
"hautelook/alice-bundle": "^2.5",
"squizlabs/php_codesniffer": "*",
"symfony/debug-pack": "*",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"symfony/web-server-bundle": "4.4.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*",
"egeloen/ckeditor-bundle": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"ckeditor:install --clear=drop": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts",
"/bin/sh -c \"if [ -f contrib/setup.sh ]; then contrib/setup.sh; fi\""
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.4.*"
}
}
}
====
Edit #5:
Here is the output of composer why twig/extensions:
sonata-project/admin-bundle 3.55.0 requires twig/extensions (^1.5)
sonata-project/core-bundle 3.17.2 requires twig/extensions (^1.5)
Here is the content of my preload.php file:
<?php
if (file_exists(dirname(__DIR__).'/var/cache/dev/srcApp_KernelDevContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/dev/srcApp_KernelDevContainer.preload.php';
}
if (file_exists(dirname(__DIR__).'/var/cache/dev/App_KernelDevContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/dev/App_KernelDevContainer.preload.php';
}
... and the referenced App_KernelDevContainer.preload.php file contains this logic that you can see here:
https://gist.github.com/patrickmaynard/0f2cff49628fe068b989a7024cd21e34
The errors
Compile Error: Cannot declare class Twig_Extensions_Extension_Text, because the name is already in use in Text.php line 15
Fatal error: Cannot redeclare twig_truncate_filter() (previously declared in vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php:38)
sound a lot like you're having multiple declarations of same method or class or you're calling include()/require() multiple times explicitly or implicitly.
Do you use include() or require() anywhere that could be called depending on opcache being effective or not?
When you use PHP autoloader, the only explicit include() calls you should have are one call to load the autoloader and all the other calls in the autoloader implementation only. And make sure you don't have include_once() nor require_once() anywhere in your codebase because those do not mix well with autoloader.
The only reason to blacklist something from the opcache should be if you need to generate code that should be reloaded. It shouldn't be used to workaround code errors (e.g. incorrect include() chains).

How to update symfony with flex?

I think my question may be stupid, but I can’t figure out how to upgrade my Symfony project from version 4.1. * to version 4.3. *.
I tried to touch the composer.json. But it sends me an error message... Does anyone have the solution?
composer.json
I had this :
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
I changed by that:
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
}
Version 4.4 does not download or update...
extra.symfony.require is for performance reasons, as symfony has too many versions and update may take a long time. To update project you also need to add 4.3.* constraint to the require section:
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "4.3.*",
"symfony/yaml": "4.3.*"
},

Having trouble installing AdminBundle

I'm trying to install Admin Bundle but it doesn't work and I don't know why,
Help me please!
$ composer require sonata-project/admin-bundle
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20131226/php_intl.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20131226/php_intl.dll, 9): image not found in Unknown on line 0
 Using version ^3.20 for sonata-project/admin-bundle
./composer.json has been updated
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 sonata-bundle/admin-bundle could not be found in any version, there may be a typo in the package name.
Problem 2
- Conclusion: remove jms/di-extra-bundle 1.5.x-dev
- sonata-project/admin-bundle 3.20.0 conflicts with jms/di-extra-bundle[1.5.x-dev].
- sonata-project/admin-bundle 3.20.1 conflicts with jms/di-extra-bundle[1.5.x-dev].
- Installation request for jms/di-extra-bundle (locked at 1.5.x-dev, required as dev-master) -> satisfiable by jms/di-extra-bundle[1.5.x-dev].
- Installation request for sonata-project/admin-bundle ^3.20 -> satisfiable by sonata-project/admin-bundle[3.20.0, 3.20.1].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
There is my composer.json
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": {
"": "src/"
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/DEVCKS/CKS-USER.git"
},
{
"type": "git",
"url": "https://github.com/DEVCKS/CKS-CORE.git"
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.4.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"stof/doctrine-extensions-bundle": "~1.1#dev",
"beberlei/DoctrineExtensions": "*",
"sonata-bundle/admin-bundle": "*",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",
"awstudio/core-bundle": "dev-master",
"friendsofsymfony/user-bundle": "dev-master",
"jms/security-extra-bundle": "dev-master",
"knplabs/knp-paginator-bundle": "~2.4",
"friendsofsymfony/jsrouting-bundle": "~1.1",
"jms/serializer-bundle": "#stable",
"jms/twig-js-bundle" : "dev-master",
"jms/twig-js": "dev-master",
"liuggio/excelbundle": "2.0",
"raulfraile/ladybug-bundle": "~1.0",
"jms/di-extra-bundle": "dev-master",
"doctrine/migrations": "1.0.*#dev",
"doctrine/doctrine-migrations-bundle": "2.1.*#dev",
"fresh/doctrine-enum-bundle": "v2.5",
"corley/maintenance-bundle": "^0.1.7"
},
"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"
],
"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"
]
},
"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.4-dev"
}
}
}
The "sonata-bundle/admin-bundle": "*", line is present in your composer.json file, but that package does not exist (causing Problem 1). Remove it
jms/di-extra-bundle is required to be installed according to your composer.json file, but sonata-project/admin-bundle specifically disallows that package to be installed (see: GH-4292). It looks like, at this time, you'll need to choose either AdminBundle or JMSDiExtraBundle to use.

Error: install sonata ecommerce

I'm trying to install sonata ecommerce , but when i run composer update, i have this Error:
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
- Can only install one of: knplabs/knp-menu-bundle[2.1.x-dev, 1.1.x-dev].
- Can only install one of: knplabs/knp-menu-bundle[v2.0.0, 1.1.x-dev].
- Can only install one of: knplabs/knp-menu-bundle[v2.0.0-alpha1, 1.1.x-dev]
.
- Can only install one of: knplabs/knp-menu-bundle[v2.0.0-alpha2, 1.1.x-dev]
.
- Can only install one of: knplabs/knp-menu-bundle[v2.1.0, 1.1.x-dev].
- Can only install one of: knplabs/knp-menu-bundle[1.1.x-dev, v2.1.0].
- sonata-project/ecommerce dev-master requires knplabs/knp-menu-bundle ~1.1
-> satisfiable by knplabs/knp-menu-bundle[1.1.x-dev].
- Installation request for sonata-project/ecommerce dev-master -> satisfiabl
e by sonata-project/ecommerce[dev-master].
- Installation request for knplabs/knp-menu-bundle ~2.0 -> satisfiable by kn
plabs/knp-menu-bundle[2.1.x-dev, v2.0.0, v2.0.0-alpha1, v2.0.0-alpha2, v2.1.0].
This is my composer json
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.7.*",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"doctrine/dbal": "<2.5",
"doctrine/doctrine-bundle": "~1.4",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "2.6.0",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~3.0,>=3.0.12",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"leafo/lessphp": "*",
"twitter/bootstrap": "*",
"mremi/contact-bundle": "dev-master",
"symfony/twig-bridge": "2.3.*",
"genemu/form-bundle": "2.2.*",
"components/jquery":"dev-master",
"friendsofsymfony/user-bundle": "~1.3",
"hwi/oauth-bundle": "0.4.*#dev",
"knplabs/gaufrette": "~0.1.6",
"knplabs/knp-menu-bundle": "~2.0",
"sonata-project/user-bundle": "2.3.*#dev",
"sonata-project/block-bundle": "~2.3#dev",
"sonata-project/admin-bundle": "~2.4#dev",
"sonata-project/page-bundle": "~2.3",
"sonata-project/datagrid-bundle": "2.2.*#dev",
"symfony-cmf/routing-bundle": "~1.1",
"sonata-project/core-bundle": "~2.2#dev",
"sonata-project/doctrine-orm-admin-bundle": "~2.2",
"sonata-project/easy-extends-bundle": "~2.1",
"sonata-project/comment-bundle": "~2.2#dev",
"sonata-project/ecommerce": "dev-master"
},
"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",
"symfony-assets-install": "relative",
"symfony-assets-install":"symlink",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.7-dev"
}
}
}
i tried to replaced "knplabs/knp-menu-bundle": "~2.0", by knplabs/knp-menu-bundle": "2.0.#dev", but i'm still having an error.
Someone have any idea how to solved my problem. Thank you :)
Important lines from the error message:
Installation request for sonata-project/ecommerce dev-master
sonata-project/ecommerce dev-master requires knplabs/knp-menu-bundle ~1.1
Installation request for knplabs/knp-menu-bundle ~2.0
So you require knplabs/knp-menu-bundle ~2.0, while sonata ecommerce requires version ~1.1. There is no version that matches both >=1.1,<2.0 and >=2.0,<3.0, resulting in a resolving conflict.
So either find a KnpMenuBundle 2 supporting version of Sonata ecommerce or downgrade to KnpMenuBundle 1 in your application.

php composer.phar update failed - A typo in the package name

I have created a new Symfony 2.1 project and added a custom package downloaded by a SVN repo.
Now I'm tryng to upgrade the project to Symfony 2.2, but anytime I try to execute the command php ~/bin/composer.phar update the following error message appears:
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 custom/utils could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
This is Symfony 2.2 composer.json:
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": [
{
"type": "vcs",
"url": "svn+ssh://sources.de.ext/usr/local/svnroot/utils"
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"custom/utils": "*"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "alpha",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}
Custom utils have following composer.json:
{
"name": "custom/utils",
"version": "1.0.0",
"description": "The Custom Libraries",
"autoload": {
"psr-0": {
"Blogo": "src/",
"WideImage": "lib/"
}
},
"require": {
"symfony/console": "2.*",
"symfony/yaml": "2.*"
}
}
Could anyone help me to understand what's wrong in new 2.2 Symfony? Because this error message appear only Symfony 2.2 upgrade.
Try running composer update --verbose or composer show custom/utils --verbose. Both will show you some output about the loading of your SVN repository. It should indicate which versions are loaded or not.
My guess is that you have a dev-trunk version available, and if you require it it will most likely work. You should not specify version: 1.0.0 in your composer.json, because composer reads the version information from tags/branches in your VCS.

Categories