I am trying to create new project using following command but it stops at last line for hours. I have pasted the output from command.
I have tried updating composer also.
$ composer create-project symfony/website-skeleton my_project_name
The script began well
Creating a "symfony/website-skeleton" project at "./my_project_name"
Installing symfony/website-skeleton (v5.0.99)
- Installing symfony/website-skeleton (v5.0.99): Loading from cache
Created project in C:\Users\Captain\Desktop\my_project_name
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing symfony/flex (v1.6.2): Loading from cache
Symfony operations: 1 recipe (2d3facef6986e76f376f76f911c83b03)
- Configuring symfony/flex (>=1.0): From github.com/symfony/recipes:master
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"
But nothing happens after this line.
When i install some libs to my symfony 4.3 project with flex:
composer require twig monolog
Outputs:
Using version ^1.0 for symfony/twig-pack
Using version ^3.4 for symfony/monolog-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Package operations: 5 installs, 0 updates, 0 removals
- Installing twig/extra-bundle (v2.12.1): Loading from cache
- Installing symfony/twig-pack (v1.0.0): Loading from cache
- Installing monolog/monolog (1.25.1): Loading from cache
- Installing symfony/monolog-bridge (v4.3.5): Loading from cache
- Installing symfony/monolog-bundle (v3.4.0): Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 2 recipes (9554635a5313eba1c8b1d73eafba51c3)
- Configuring twig/extra-bundle (>=v2.12.1): From auto-generated recipe
- Configuring symfony/monolog-bundle (>=3.3): From github.com/symfony/recipes:master
Executing script cache:clear
They are added to symfony.lock but not to composer.json.
So when i next run
composer update
The libraries are removed and unconfigured again.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Package operations: 0 installs, 0 updates, 5 removals
- Removing twig/extra-bundle (v2.12.1)
- Removing symfony/twig-pack (v1.0.0)
- Removing symfony/monolog-bundle (v3.4.0)
- Removing symfony/monolog-bridge (v4.3.5)
- Removing monolog/monolog (1.25.1)
Writing lock file
Generating autoload files
Symfony operations: 2 recipes (0637fcde6e70b4f7a32f5fed62f0c462)
- Unconfiguring twig/extra-bundle (>=v2.12.1): From auto-generated recipe
- Unconfiguring symfony/monolog-bundle (>=3.3): From github.com/symfony/recipes:master
Executing script cache:clear
Is this normal behaviour?
Seems a bit odd to me.
This happened because there was an error in the project during the following cache:clear in composer update.
Installation failed, reverting ./composer.json to its original
content.
Then composer or flex starts a rollback and the composer.json is not updated, the symfony.lock however remains updated.
I have facing some troubles to install FosUserBundle in Symfony 2.8. I haven't had this problem before in others projects.
I have tried:
composer require friendsofsymfony/user-bundle "~2.0"
php composer.phar update friendsofsymfony/user-bundle with "friendsofsymfony/user-bundle": "~2.0" in the required section of composer.json.
With both options I get this error:
C:\xampp\htdocs\MiAplicacion>composer require friendsofsymfony/user-bundle "~2 .0" ./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
- Conclusion: remove twig/twig v1.23.1
- Conclusion: don't install twig/twig v2.3.2
- Installation request for friendsofsymfony/user-bundle ~2.0 -> satisfiable by friendsofsymfony/user-bundle[v2.0.0].
- Conclusion: don't install twig/twig v1.23.1
- friendsofsymfony/user-bundle v2.0.0 requires twig/twig ^1.28 || ^2.0 -> sa tisfiable by twig/twig[v1.28.0, v1.28.1, v1.28.2, v1.29.0, v1.30.0, v1.31.0, v1.
32.0, v1.33.0, v1.33.1, v1.33.2, v2.0.0, v2.1.0, v2.2.0, v2.3.0, v2.3.1, v2.3.2] .
- Can only install one of: twig/twig[v1.28.0, v1.23.1].
- Can only install one of: twig/twig[v1.28.1, v1.23.1].
- Can only install one of: twig/twig[v1.28.2, v1.23.1].
- Can only install one of: twig/twig[v1.29.0, v1.23.1].
- Can only install one of: twig/twig[v1.30.0, v1.23.1].
- Can only install one of: twig/twig[v1.31.0, v1.23.1].
- Can only install one of: twig/twig[v1.32.0, v1.23.1].
- Can only install one of: twig/twig[v1.33.0, v1.23.1].
- Can only install one of: twig/twig[v1.33.1, v1.23.1].
- Can only install one of: twig/twig[v1.33.2, v1.23.1].
- Can only install one of: twig/twig[v2.0.0, v1.23.1].
- Can only install one of: twig/twig[v2.1.0, v1.23.1].
- Can only install one of: twig/twig[v2.2.0, v1.23.1].
- Can only install one of: twig/twig[v2.3.0, v1.23.1].
- Can only install one of: twig/twig[v2.3.1, v1.23.1].
- Installation request for twig/twig (locked at v1.23.1) -> satisfiable by t wig/twig[v1.23.1].
Installation failed, reverting ./composer.json to its original content.
My required in composer.json is (I added the last row from the original symfony project):
"require": {
"php": ">=5.3.9",
"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",
"friendsofsymfony/user-bundle": "~2.0"
},
Can I fix the composer issue?
If not, there is any way to install FosUserBundle downloading it manually and copying it in my project?
I don't know if you have upgraded to Symfony 2.8 manually or with a fresh installation but as composer shows, to install "friendsofsymfony/user-bundle": "~2.0" you should have at minimum twig ^1.28 so I think you should resolve this problem adding the line "twig/twig": "~1.28|~2.0" to the composer require section to force the upgrade.
If the error comes again with this message part Installation request for twig/twig (locked at v1.23.1) you should take a look (one by one) at which package block the upgrade. At a first look seems nothing wrong in your composer.json.
When i run composer.phar install everything seems nice:
→ sudo php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for FOS\JsRoutingBundle into web/bundles/fosjsrouting
etc etc
But now, i want install this bundle: https://github.com/KnpLabs/KnpPaginatorBundle from https://packagist.org/packages/knplabs/knp-paginator-bundle
So i update the composer.json file with new require line.
{
"require": {
"knplabs/knp-paginator-bundle": "v2.1"
}
}
( i have tried every version of paginator from packegist and still the same error)
Then i try to install it:
→ sudo php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/framework-standard-edition 2.1.x-dev -> satisfiable by symfony/framework-standard-edition[2.1.x-dev].
- symfony/framework-standard-edition 2.1.x-dev requires knplabs/knp-paginator-bundle v2.1 -> 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.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
And the symfony2 line of my current composer.json:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"symfony/symfony": "2.1.x-dev" did not help
What should i do please?
you should run this command in project directory :
php composer.phar update
After hours i finally found the solution!
I dont know if my composer.json dependencies are somehow not in the best shape but what solved my problem is updating and installing only the required bundles!
woooot??? What have i just said??? yes, ONLY THE REQUIRED BUNDLES so...
sudo php composer.phar require
Then just find the bundle of your desires by composer cool search from https://packagist.org .
Choose the number from list and fill the version.
It will download the bundle,
update the composer.json and composer.lock files :)
Hope this answer will help someone!
$ php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Terminated
Composer terminated when I try to update dependencies in my symfony2 application. Where can be problem?
Edit
I tried to run composer diag and output was:
Checking platform settings: OK
Checking http connectivity: OK
Checking composer.json:
[ErrorException]
Undefined index: require-dev
But there is no line "require-dev" in my composer.json.