i would like update my symfony projet ( current 2.8 to sf 3.* )
this is my composer.json file ( requiere part )
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"sonata-project/media-bundle": "^2.3",
"sonata-project/user-bundle": "^2.2",
"sonata-project/formatter-bundle": "~2.3",
"sonata-project/doctrine-orm-admin-bundle": "~2.2",
"sonata-project/admin-bundle": "~2.2",
"sonata-project/timeline-bundle": "^2.2",
"sonata-project/intl-bundle": "^2.2",
"sonata-project/cache-bundle": "^2.2",
"liuggio/excelbundle": "^2.0",
"friendsofsymfony/elastica-bundle": "^3.1",
"liip/imagine-bundle": "^1.4",
"friendsofsymfony/jsrouting-bundle": "^1.6",
"gos/web-socket-bundle": "^1.8"
},
If i change
"symfony/symfony": "2.8.*",
to
"symfony/symfony": "~3.0",
and do
php composer.phar update symfony/symfony --with-dependencies
but i have this error
Problem 1
- sonata-project/media-bundle 2.3.4 requires symfony/symfony ~2.3 -> satisfiable by symfony/symfony
So i tried to update media-bundle to 3.10.1 but it give me an error in another sonata bundle ..
how should I do things right?
I have to update the modules one by one?
or update my composer.json with all modifications ?
thanks
Your sonata dependencies are very too old and does not support Symfony 3.
Sample: https://github.com/sonata-project/SonataMediaBundle/blob/2.x/composer.json
You must upgrade your dependencies to make it working.
Also, you can use the composer why-not command to get more help.
I also got stuck in this error a few times. The error message is kinda abstract.
To solve this error you need to update the version for sonata-project/media-bundle in your composer.json file.
So you can replace it with: "sonata-project/media-bundle": "^3.1",
Then run composer update command again. You might get the same error you got above but for another package. Update that as well. Repeat this until your composer update command is successful.
At that point, if you are lucky your application will work. If not you need to update the code to use the new package version code. Remember, updating the first number of a package (from 2.8 to 3.something) means that is a breaking compatibility update.
Later update: if you check the composer.json file of sonata-project/media-bundle version 2.3 here: https://github.com/sonata-project/SonataMediaBundle/blob/2.3.0/composer.json you will see that it requires symfony version: "symfony/symfony": "~2.3" and you want to update to symfony version 3.something. So they are incompatible. That's why you also need to update this package and so on. Composer will do this behind the scenes and throw that error when your packages or their dependencies are not compatible between them.
Hope that helps.
Related
I need to use sonata e commerce capabilities in my project but I have't had any success so far. It seems that there is not a compatible version with my current setup.
Here is my composer file
"require": {
"php": ">=5.3",
"ext-soap": "*",
"ext-gd": "*",
"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",
"knplabs/knp-last-tweets-bundle": "*",
"friendsofsymfony/rest-bundle":"^1.8",
"twig/extensions":"1.2",
"friendsofsymfony/oauth-server-bundle": "dev-master",
"hwi/oauth-bundle": "^0.4.2",
"sonata-project/admin-bundle": "2.x.dev",
"sonata-project/doctrine-orm-admin-bundle": "2.x.dev",
"sonata-project/media-bundle": "~2.3",
"sonata-project/classification-bundle": "2.x-dev",
"sonata-project/user-bundle": "2.x.dev",
"sonata-project/block-bundle": "2.2.*"
},
When I run composer require sonata-project/ecommerce-bundle composer cant find a version that works with my current setup.
The error message that I get is
Problem 1
- Installation request for sonata-project/ecommerce ^2.0 -> satisfiable by sonata-project/ecommerce[2.0.0].
- sonata-project/ecommerce 2.0.0 requires sonata-project/block-bundle ^3.0 -> satisfiable by sonata-project/block-bundle[3.0.0, 3.0.1, 3.1.0, 3.1.1, 3.x-dev] but these conflict with your requirements or minimum-stability.
Please help. I have more than 3 days trying to get this working.
Some issues are going to be fixed when this PR is merged: https://github.com/sonata-project/sandbox/pull/583
So just wait a few days, or patch some code ;)
I'm totally new to composer and symfony, and i've started a symfony3 project. Things where going well, but now composer won't update my dependancies. I've been searching a solution for 3 hours.
Here is my console log:
Problem 1
- sonata-project/admin-bundle dev-master requires sonata-project/block-bundle 3.x-dev#dev -> satisfiable by sonata-project/block-bundle[3.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/admin-bundle dev-master requires sonata-project/block-bundle 3.x-dev#dev -> satisfiable by sonata-project/block-bundle[3.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for sonata-project/admin-bundle dev-master -> satisfiable by sonata-project/admin-bundle[dev-master].
And my composer.json requirements:
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.0.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"friendsofsymfony/user-bundle": "dev-master",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master"
},
If you can find the problem, and explain it to me, you're going to be my hero!
By default, composer installs only stable versions of packages, even if you ask a dev version for one of them, by defining the minimum-stability to stable.
To tell composer that you allow installation of development versions (such as dev-master),
Add the following line after your requirements:
"minimum-stability": "dev"
Note: It's actually mandatory to work with last versions of sonata bundles.
G'day all, I'm afraid yet another newbie is stuck trying to glue all the bits together. It's rather frustrating, to say the least :(
I've searched these forums, and see countless possible solutions, but none have worked so far. Most also also quite old, and versions have moved on.
Here we go:
https://sonata-project.org/bundles/user/2-2/doc/reference/installation.html
When I try this: composer require sonata-project/easy-extends-bundle
I get this:
Using version ^2.1 for sonata-project/easy-extends-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-project/admin-bundle == 2.3.7.0 could not be found. Problem 2
- Can only install one of: sonata-project/block-bundle[2.3.8, 2.2.13].
- Can only install one of: sonata-project/block-bundle[2.3.8, 2.2.13].
- Can only install one of: sonata-project/block-bundle[2.3.8, 2.2.13].
- sonata-project/admin-bundle dev-master requires sonata-project/block-bundle ^2.3.8 -> satisfiable by
sonata-project/block-bundle[2.3.8].
- Installation request for sonata-project/admin-bundle dev-master -> satisfiable by sonata-project/admin-bundle[dev-master].
- Installation request for sonata-project/block-bundle == 2.2.13.0 -> satisfiable by sonata-project/block-bundle[2.2.13].
Potential causes:- A typo in the package name - The
package is not available in a stable-enough version according to your
minimum-stability setting
Installation failed, reverting ./composer.json to its original
content.
I'm just following instructions, plain and simple! I read those articles, and tried a few solutions here, and via a Google search.
For what it's worth, I'm an old Unix hacker from way back, and I don't remember open source builds being this hard ...
Any clues? Many thanks in advance!
p.s. I'm using a Debian virtual box, as I thought it'd be easier than trying things on my Windows 8 PC.
Here is the only changed section from composer.json:
"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",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"sonata-project/admin-bundle": "2.3.*",
"sonata-project/doctrine-orm-admin-bundle": "^2.3",
"sonata-project/easy-extends-bundle": "^2.1",
"sonata-project/user-bundle": "^2.2",
"sonata-project/easy-extends-bundle": "dev-master"
},
1. Empty the vendor folder: Delete everything on it, but don't delete itself. Maybe a broken downloaded dependency is causing you issues.
2. Replace your require section of your composer.json with this one:
"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",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~1.3",
"sonata-project/admin-bundle": "2.3.*",
"sonata-project/doctrine-orm-admin-bundle": "^2.3",
"sonata-project/easy-extends-bundle": "^2.1",
"sonata-project/user-bundle": "^2.2"
},
Notice the difference about "friendsofsymfony/user-bundle" version.
Now it should work! Let me know if it's still causing you issues.
I'm trying out Symfony but I'm running into some problems after I decided I wan't to test Migrations.
From the docs I learn I have to add this to the composer json.
"doctrine/doctrine-migrations-bundle": "dev-master",
So this is what I have now:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/doctrine-migrations-bundle": "dev-master",
"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"
},
But this isn't working. It cannot find the right version.
This is the error:
Problem 1
- Installation request for doctrine/doctrine-migrations-bundle dev-master -> satisfiable by doctrine/doctrine-migrations-bundle[dev-master].
- doctrine/doctrine-migrations-bundle dev-master requires doctrine/migrations * -> no matching package found.
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.
After this and a lot of googling (https://github.com/doctrine/DoctrineMigrationsBundle/issues/54) and trying I tried to set the version for "doctrine/doctrine-bundle": "~1.2", to require the aplha version. This did continue the installation but introduces a new problem.
After adding this line to the app kernel into the $bundles array:
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
I try to run this in the terminal: php app/console doctrine:migrations:status
But it gives me the following error:
Fatal error: Class 'Doctrine\DBAL\Migrations\Tools\Console\Command\LatestCommand' not found in /Applications/MAMP/htdocs/symfony/vendor/doctrine/doctrine-migrations-bundle/Doctrine/Bundle/MigrationsBundle/Command/MigrationsLatestDoctrineCommand.php on line 30
Right now I really don't know what I'm missing. I have no clue how to get this working. I hope someone can give me a push in the right direction! Thanks!
If you want to install the doctrine/doctrine-migrations-bundle you are also required to install doctrine/migrations. Based on your copy/paste of you composer.json, you forgot to add it.
Try with the following :
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/migrations" : "dev-master",
"doctrine/doctrine-migrations-bundle" : "dev-master",
"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"
},
You are getting this error :
Fatal error: Class 'Doctrine\DBAL\Migrations\Tools\Console\Command\LatestCommand' not found in /Applications/MAMP/htdocs/symfony/vendor/doctrine/doctrine-migrations-bundle/Doctrine/Bundle/MigrationsBundle/Command/MigrationsLatestDoctrineCommand.php on line 30
because doctrine/migrations has not been downloaded and several classes are missing for the doctrine/doctrine-migrations-bundle.
You should check https://packagist.org/packages/doctrine/doctrine-migrations-bundle and try installing the latest version. Specifying more exact versions is better for overall stability as a composer update that gets the most up to date packages may have cause and effect on the stability of your application.
I am trying to extend an existing Symfony application, but the composer.json doesn't make any sense.
"symfony/symfony": "2.1.*"
Results in an error because 2.1.* is not a resolvable version number this would indicate that the programmer hasn't bothered to update the file or use it.
Then I try it by changing it to:
"symfony/symfony": "2.1.12"
It then fails because:
mopa/bootstrap-bundle dev-master requires symfony/symfony ~2.3-dev
jms/di-extra-bundle 1.1.0-RC requires symfony/framework-bundle 2.1.*
This would suggest I can either install bootstrap or jms because one requires symfony 2.1 and the other 2.3 but in the composer.phar I see:
"jms/di-extra-bundle": "1.1.*",
"mopa/bootstrap-bundle": "dev-master",
In the production server I see that vendor has a jsm and mopa sub directory and under vendor/symfony/symfony the highest changelog I can find is CHANGELOG-2.1.md suggesting that some version of Symfony 2.1 is used (only have ftp access so can't run a command to check the version).
I wonder how I can get this installed because it just quits every time on the Symfony version not getting resolved.
The other thing is; should I resolve this. If one of these packages don't run because of a wrong Symfony version that what's the point of installing it in the first place?
If you are updating from a previous version of symfony you had to update all dependeciens. So looking https://github.com/symfony/symfony-standard/blob/v2.1.11/composer.json you have to set:
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.5-dev",
"doctrine/doctrine-bundle": "1.1.*",
"twig/extensions": "1.0.*#dev",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.1.*",
"symfony/monolog-bundle": "2.1.*",
"sensio/distribution-bundle": "2.1.*",
"sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"kriswallsmith/assetic": "1.1.*#dev"
and looking for MopaBootstrapBundle on packagist (https://packagist.org/packages/mopa/bootstrap-bundle) the last version that support Symfony 2.1 is:
"mopa/bootstrap-bundle": "2.2.*#dev"