2
votes

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?

2

2 Answers

2
votes

you should run this command in project directory :

php composer.phar update
1
votes

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!