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!
Related
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
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.
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:
I have a problem when i install a new bundle, when i use this command:
php composer.phar require mesd/jasper-report-bundle "~1.0"
It displays the following error:
C:\wamp\www\ADMSymfony>php composer.phar require mesd/jasper-report-bundle "~1.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
- The requested package friendsofsymfony/user-bundle == 1.3.5.0 could not be 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 <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
here is my composer.json :
{
"require": {
"friendsofsymfony/user-bundle": "~2.0#dev",
"widop/google-analytics-bundle": "*",
"whiteoctober/tcpdf-bundle": "*",
"knplabs/knp-snappy-bundle": "dev-master"
}
}
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?