Symfony2 "php composer.phar" keeps ending with "Killed" - symfony

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?

Related

Almost empty symfony install ( missing vendors except for flex )

symfony new my-project
is supposed to install a basic working symfony app but it gives me a project that's almost empty, with only composer.json, composer.lock and a vendor directory with only symfony/flex.
composer.json does include symfony/framework-bundle, but the bundle is not in vendors.
Running composer install does not do anything, and doesn't give an error.
Installing php-zip solved it for me (required by composer).
Looks like it might not be installed by default on recent ubuntu php installations, and either composer or the symfony binary failed silently.
sudo apt install php-zip
# now install vendors
composer update

Symfony Composer create-project stucks at Restricting packages listed in "symfony/symfony" to "5.0.*"

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.

Error with composer when I want to install friendsofsymfony/elastica-bundle

I want to install friendsofsymfony/elastica-bundle via composer, but I got an error with symfony/flex. I tried to update symfony/flex via composer but always the same error and also composer load from the cache the version v1.0.80 but I have in the file composer.json the version 1.4.2 . I tried to uninstall composer and install it again but it's working too.
Thank you for your help. This is the error I find:

Wrong version of Symfony got installed

I'm trying to check out(try) symfony 4, but when I try to install it via composer, the version 3.4.5 is getting installed?
I have used the same commands given in the docs
composer create-project symfony/skeleton symfony_4_practice
Installing symfony/skeleton (v3.4.5)
- Installing symfony/skeleton (v3.4.5): Downloading (100%)
Can anyone help me resolve this?
You must have php < 7.1, hence the Symfony 3.4
Upgrade to PHP 7.1 or more and you'll be all set.
Edit: as precised per bouchon, the PHP requirement can be found on the packagist package page.
It is also possible to see that directly in the package composer.json.
Can you try with:
composer create-project symfony/skeleton:4.0 symfony_4_practice
this command force the version
try this please:
composer self-update
composer create-project symfony/skeleton symfony_4_practice
I think you need to update composer only

symfony2.1.7 composer install KnpPaginatorBundle

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!

Resources