$ 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.
Related
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.
Problem compatibility
This mounted in docker
Problem execute
compose exec php ./install.sh
my file contains
bin/console cache:clear --env=prod
ERROR:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/dotenv v3.4.15 -> satisfiable by symfony/dotenv[v3.4.15].
- don't install symfony/symfony v3.3.18|don't install symfony/dotenv v3.4.15
- Installation request for symfony/symfony v3.3.18 -> satisfiable by symfony/symfony[v3.3.18].
Warning: require(/var/www/symfony/bin/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/symfony/bin/console on line 15
Call Stack:
0.0001 367080 1. {main}() /var/www/symfony/bin/console:0
Fatal error: require(): Failed opening required '/var/www/symfony/bin/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/symfony/bin/console on line 15
Call Stack:
0.0001 367080 1. {main}() /var/www/symfony/bin/console:0
Any ideas?
Try so: Update symfony and install after symfony/dotenv
I am using composer.phar to install third party bundles in Symfony2. But whenever I run
php composer.phar update
or with any other composer.phar option, it shows:
Loading composer repositories with package information
Updating dependencies (including require-dev)
and then "Killed".
I tried to search on this on the web, but didn't really find anything helpful.
Why do you think this is happening?
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!