Composer create-project symfony/skeleton new_project "4.0" - symfony

It installs:
Symfony 4.1.3 (kernel: src, env: dev, debug: true)
How do I get it to install exactly 4.0.*?
composer create-project symfony/skeleton new_project "4.0" Installing symfony/skeleton (v4.0.0)
- Installing symfony/skeleton (v4.0.0): Loading from cache Created project in aaaa Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 22 installs, 0 updates, 0 removals
- Installing symfony/flex (v1.0.89): Loading from cache
- Installing symfony/polyfill-mbstring (v1.9.0): Loading from cache
- Installing symfony/console (v4.1.3): Loading from cache
- Installing symfony/routing (v4.1.3): Loading from cache
- Installing symfony/polyfill-ctype (v1.9.0): Loading from cache
- Installing symfony/http-foundation (v4.1.3): Loading from cache
- Installing symfony/event-dispatcher (v4.1.3): Loading from cache
- Installing psr/log (1.0.2): Loading from cache
- Installing symfony/debug (v4.1.3): Loading from cache
- Installing symfony/http-kernel (v4.1.3): Loading from cache
- Installing symfony/finder (v4.1.3): Loading from cache
- Installing symfony/filesystem (v4.1.3): Loading from cache
- Installing psr/container (1.0.0): Loading from cache
- Installing symfony/dependency-injection (v4.1.3): Loading from cache
- Installing symfony/config (v4.1.3): Loading from cache
- Installing psr/simple-cache (1.0.1): Loading from cache
- Installing psr/cache (1.0.1): Loading from cache
- Installing symfony/cache (v4.1.3): Loading from cache
- Installing symfony/framework-bundle (v4.1.3): Loading from cache
- Installing symfony/yaml (v4.1.3): Loading from cache
- Installing symfony/dotenv (v4.1.3): Loading from cache Writing lock file Generating autoload files Symfony operations: 4 recipes (df8c84407bbee5e3e826455e7bbdef65)
- Configuring symfony/flex (>=1.0): From github.com/symfony/recipes:master
- Configuring symfony/framework-bundle (>=3.3): From github.com/symfony/recipes:master
- Configuring symfony/console (>=3.3): From github.com/symfony/recipes:master
- Configuring symfony/routing (>=4.0): From github.com/symfony/recipes:master
Executing script cache:clear [OK]
Executing script assets:install public [OK]

Try it this way:
composer create-project symfony/skeleton new_project 4.0.*
More info in composer documentation - https://getcomposer.org/doc/03-cli.md#create-project
Also, Symfony 4.0.* is no longer maintained. Consider upgrading to 4.1

Just installing as it is:
composer create-project symfony/skeleton new_project 4.0
it will install 4.1.3 and then changing in composer.json symfony/framework-bundle to "~4.0.0" and then composer update

Related

composer update removes previously installed packages from symfony flex

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.

Drupal - error installing module "entity"

I have a Drupal installation within a Docker container, with Composer and Drush installed. I'd like to install the Entity-API module (https://www.drupal.org/project/entity), and I start off with:
composer require drupal/entity
This gives me an error:
Using version ^0.1.0 for drupal/entity
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
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
- Can only install one of: drupal/core[8.5.6, 8.0.x-dev].
- Can only install one of: drupal/core[8.0.x-dev, 8.5.6].
- Can only install one of: drupal/core[8.0.x-dev, 8.5.6].
- drupal/entity 0.1.0 requires drupal/core <8.1.0 -> satisfiable by drupal/core[8.0.x-dev].
- Installation request for drupal/entity ^0.1.0 -> satisfiable by drupal/entity[0.1.0].
- Installation request for drupal/core (locked at 8.5.6, required as ~8.5.3) -> satisfiable by drupal/core[8.5.6].
Installation failed, reverting ./composer.json to its original content.
My Drupal version is 8.5.6 and I'm using the latest version of Composer, installed from https://getcomposer.org/installer
How would I get this installed using Composer? Tx
Use --update-with-all-dependencies switch:
composer require drupal/entity --update-with-all-dependencies
--update-with-all-dependencies: Also update dependencies of the newly required packages, including those that are root requirements.
https://getcomposer.org/doc/03-cli.md#require

Install Sonata News Bundle composer error

i'm trying to use sonata-project/new-bundle.
I start with creating a new fresh symfony 2.8 project.
After i follow, the install guides from the official website
https://sonata-project.org/bundles/news/master/doc/reference/installation.html
I run these commands
composer require sonata-project/news-bundle "dev-master" --no-update
composer require sonata-project/doctrine-orm-admin-bundle "dev-master" --no-update
composer require sonata-project/easy-extends-bundle "dev-master" --no-update
composer require friendsofsymfony/rest-bundle "~1.1" --no-update
composer require nelmio/api-doc-bundle "~0.1|~1.0" --no-update
composer require sonata-project/classification-bundle "~2.2#dev"
but i have these errors in my console :/
./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
- Installation request for sonata-project/news-bundle dev-master -> satisfiable by sonata-project/news-bundle[dev-master].
- sonata-project/doctrine-orm-admin-bundle dev-master conflicts with sonata-project/news-bundle[dev-master].
- Installation request for sonata-project/doctrine-orm-admin-bundle dev-master -> satisfiable by sonata-project/doctrine-orm-admin-bundle[dev-master].
Installation failed, reverting ./composer.json to its original content.
What's wrong ?
thanks you for your response.
Using dev-master everywhere is what's wrong. You should never do that. I see that's what is written in the docs, so I'll make a PR to change that, sorry you had to read that.
IMO, your best option is to simply let Composer pick what versions it should use, instead of constraining it :
composer require sonata-project/news-bundle sonata-project/doctrine-orm-admin-bundle sonata-project/easy-extends-bundle friendsofsymfony/rest-bundle nelmio/api-doc-bundle sonata-project/classification-bundle
Using version ^3.0 for sonata-project/news-bundle
Using version ^3.1 for sonata-project/doctrine-orm-admin-bundle
Using version ^2.1 for sonata-project/easy-extends-bundle
Using version ^2.1 for friendsofsymfony/rest-bundle
Using version ^2.13 for nelmio/api-doc-bundle
Using version ^3.1 for sonata-project/classification-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
This does not work for me though I have this error :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- sonata-project/user-bundle 3.0.1 requires friendsofsymfony/rest-bundle ^1.1 -> satisfiable by friendsofsymfony/rest-bundle[1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.3.1, 1.4.0, 1.4.0-RC1, 1.4.1, 1.4.2, 1.5.0, 1.5.0-RC1, 1.5.0-RC2, 1.5.0-RC3, 1.5.0-RC4, 1.5.0-RC5, 1.5.1, 1.5.2, 1.5.3, 1.5.x-dev, 1.6.0, 1.6.0-RC1, 1.6.0-RC2, 1.6.1, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.x-dev, 1.8.0, 1.8.0-BETA1, 1.8.0-BETA2, 1.8.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/user-bundle 3.0.0 requires friendsofsymfony/rest-bundle ^1.1 -> satisfiable by friendsofsymfony/rest-bundle[1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.3.1, 1.4.0, 1.4.0-RC1, 1.4.1, 1.4.2, 1.5.0, 1.5.0-RC1, 1.5.0-RC2, 1.5.0-RC3, 1.5.0-RC4, 1.5.0-RC5, 1.5.1, 1.5.2, 1.5.3, 1.5.x-dev, 1.6.0, 1.6.0-RC1, 1.6.0-RC2, 1.6.1, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.x-dev, 1.8.0, 1.8.0-BETA1, 1.8.0-BETA2, 1.8.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for sonata-project/news-bundle ^3.0 -> satisfiable by sonata-project/news-bundle[3.0.0].
- friendsofsymfony/rest-bundle 2.1.0 conflicts with sonata-project/user-bundle[3.1.0].
- sonata-project/news-bundle 3.0.0 requires sonata-project/user-bundle ^3.0 -> satisfiable by sonata-project/user-bundle[3.0.0, 3.0.1, 3.1.0].
- Installation request for friendsofsymfony/rest-bundle ^2.1 -> satisfiable by friendsofsymfony/rest-bundle[2.1.0].
The doc says "friendsofsymfony/rest-bundle and nelmio/api-doc-bundle are needed only if you use the API." So let's say you don't :
composer require sonata-project/news-bundle sonata-project/doctrine-orm-admin-bundle sonata-project/easy-extends-bundle sonata-project/classification-bundle
Using version ^3.0 for sonata-project/news-bundle
Using version ^3.1 for sonata-project/doctrine-orm-admin-bundle
Using version ^2.1 for sonata-project/easy-extends-bundle
Using version ^3.1 for sonata-project/classification-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing twig/twig (v1.26.1)
Loading from cache
- Installing symfony/polyfill-mbstring (v1.2.0)
Loading from cache
- Installing psr/log (1.0.2)
Loading from cache
- Installing doctrine/lexer (v1.0.1)
Loading from cache
- Installing doctrine/inflector (v1.1.0)
Loading from cache
- Installing doctrine/collections (v1.3.0)
Loading from cache
- Installing doctrine/cache (v1.6.0)
Loading from cache
- Installing doctrine/annotations (v1.2.7)
Loading from cache
- Installing doctrine/common (v2.6.1)
Loading from cache
- Installing symfony/polyfill-apcu (v1.2.0)
Loading from cache
- Installing symfony/security-acl (v3.0.0)
Loading from cache
- Installing symfony/symfony (v2.8.12)
Downloading: 100%
- Installing symfony/polyfill-php54 (v1.2.0)
Loading from cache
- Installing symfony/polyfill-intl-icu (v1.2.0)
Loading from cache
- Installing symfony/polyfill-util (v1.2.0)
Loading from cache
- Installing paragonie/random_compat (v2.0.3)
Downloading: 100%
- Installing symfony/polyfill-php70 (v1.2.0)
Loading from cache
- Installing symfony/polyfill-php56 (v1.2.0)
Loading from cache
- Installing ircmaxell/password-compat (v1.0.4)
Loading from cache
- Installing symfony/polyfill-php55 (v1.2.0)
Loading from cache
- Installing cocur/slugify (v2.3)
Loading from cache
- Installing sonata-project/core-bundle (3.1.1)
Loading from cache
- Installing sonata-project/datagrid-bundle (2.2)
Loading from cache
- Installing sonata-project/intl-bundle (2.2.4)
Loading from cache
- Installing sonata-project/easy-extends-bundle (2.1.10)
Loading from cache
- Installing sonata-project/cache (1.0.7)
Loading from cache
- Installing sonata-project/block-bundle (3.2.0)
Downloading: 100%
- Installing egeloen/json-builder (2.0.1)
Loading from cache
- Installing egeloen/ckeditor-bundle (4.0.5)
Downloading: 100%
- Installing michelf/php-markdown (1.6.0)
Loading from cache
- Installing knplabs/knp-markdown-bundle (1.5.1)
Loading from cache
- Installing sonata-project/formatter-bundle (3.0.1)
Loading from cache
- Installing twig/extensions (v1.4.0)
Downloading: 100%
- Installing sonata-project/exporter (1.7.0)
Loading from cache
- Installing knplabs/knp-menu (2.2.0)
Downloading: 100%
- Installing knplabs/knp-menu-bundle (2.1.3)
Downloading: 100%
- Installing sonata-project/admin-bundle (3.9.0)
Downloading: 100%
- Installing doctrine/instantiator (1.0.5)
Loading from cache
- Installing doctrine/dbal (v2.5.5)
Loading from cache
- Installing doctrine/orm (v2.5.5)
Loading from cache
- Installing sonata-project/doctrine-orm-admin-bundle (3.1.1)
Downloading: 100%
- Installing sonata-project/classification-bundle (3.1.0)
Loading from cache
- Installing phpoption/phpoption (1.5.0)
Loading from cache
- Installing phpcollection/phpcollection (0.5.0)
Loading from cache
- Installing jms/parser-lib (1.0.0)
Loading from cache
- Installing jms/metadata (1.5.1)
Loading from cache
- Installing jms/serializer (1.3.1)
Loading from cache
- Installing jms/serializer-bundle (1.1.0)
Loading from cache
- Installing kriswallsmith/buzz (v0.15)
Loading from cache
- Installing imagine/imagine (v0.6.3)
Loading from cache
- Installing knplabs/gaufrette (0.2.1)
Loading from cache
- Installing sonata-project/doctrine-extensions (1.0.2)
Loading from cache
- Installing zendframework/zenddiagnostics (v1.0.9)
Loading from cache
- Installing sonata-project/notification-bundle (3.0.0)
Loading from cache
- Installing sonata-project/media-bundle (3.3.0)
Downloading: 100%
- Installing sonata-project/google-authenticator (1.0.2)
Loading from cache
- Installing friendsofsymfony/user-bundle (v1.3.6)
Loading from cache
- Installing sonata-project/user-bundle (3.1.0)
Downloading: 100%
- Installing sonata-project/news-bundle (3.0.0)
Downloading: 100%
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
sonata-project/cache suggests installing doctrine/phpcr-odm (PHPCR ODM support)
sonata-project/cache suggests installing ext-memcached (Caching with ext/memcached)
sonata-project/cache suggests installing predis/predis (Install redis php)
sonata-project/block-bundle suggests installing sonata-project/cache-bundle (^3.0)
egeloen/ckeditor-bundle suggests installing egeloen/form-extra-bundle (Allows to load CKEditor asynchronously)
knplabs/knp-markdown-bundle suggests installing ext-sundown (to use optional support for php-sundown extension instead of php implementation)
sonata-project/exporter suggests installing propel/propel1 (^1.6)
knplabs/knp-menu suggests installing pimple/pimple (for the built-in implementations of the menu provider and renderer provider)
knplabs/knp-menu suggests installing silex/silex (for the integration with your silex application)
sonata-project/admin-bundle suggests installing jms/di-extra-bundle (Annotations for Admin definition)
sonata-project/admin-bundle suggests installing jms/translation-bundle (Extract message keys from Admins)
sonata-project/admin-bundle suggests installing sensio/generator-bundle (Add sonata:admin:generate command)
sonata-project/doctrine-orm-admin-bundle suggests installing simplethings/entity-audit-bundle (If you want to support for versioning of entities and their associations.)
jms/serializer-bundle suggests installing jms/di-extra-bundle (Required to get lazy loading (de)serialization visitors, ~1.3)
imagine/imagine suggests installing ext-imagick (to use the Imagick implementation)
imagine/imagine suggests installing ext-gmagick (to use the Gmagick implementation)
knplabs/gaufrette suggests installing amazonwebservices/aws-sdk-for-php (to use the legacy Amazon S3 adapters)
knplabs/gaufrette suggests installing aws/aws-sdk-php (to use the Amazon S3 adapter)
knplabs/gaufrette suggests installing dropbox-php/dropbox-php (to use the Dropbox adapter)
knplabs/gaufrette suggests installing google/apiclient (to use GoogleCloudStorage adapter)
knplabs/gaufrette suggests installing herzult/php-ssh (to use SFtp adapter)
knplabs/gaufrette suggests installing knplabs/knp-gaufrette-bundle (to use with Symfony2)
knplabs/gaufrette suggests installing microsoft/windowsazure (to use Microsoft Azure Blob Storage adapter)
knplabs/gaufrette suggests installing phpseclib/phpseclib (to use PhpseclibSftp adapter)
knplabs/gaufrette suggests installing rackspace/php-opencloud (to use Opencloud adapter)
zendframework/zenddiagnostics suggests installing sensiolabs/security-checker (Required by Check\SecurityAdvisory)
zendframework/zenddiagnostics suggests installing guzzle/http (Required by Check\GuzzleHttpService)
zendframework/zenddiagnostics suggests installing predis/predis (Required by Check\Redis)
zendframework/zenddiagnostics suggests installing videlalvaro/php-amqplib (Required by Check\RabbitMQ)
zendframework/zenddiagnostics suggests installing doctrine/migrations (Required by Check\DoctrineMigration)
sonata-project/notification-bundle suggests installing guzzle/guzzle (^3.9)
sonata-project/notification-bundle suggests installing liip/monitor-bundle (^1.0)
sonata-project/notification-bundle suggests installing videlalvaro/php-amqplib (^2.0)
sonata-project/media-bundle suggests installing liip/imagine-bundle (^0.9)
sonata-project/media-bundle suggests installing rackspace/php-opencloud (^1.6)
sonata-project/media-bundle suggests installing sonata-project/seo-bundle (^2.0)
sonata-project/media-bundle suggests installing tilleuls/ckeditor-sonata-media-bundle (^1.0)
friendsofsymfony/user-bundle suggests installing willdurand/propel-typehintable-behavior (Needed when using the propel implementation)
sonata-project/user-bundle suggests installing friendsofsymfony/rest-bundle (For using the public API methods.)
sonata-project/user-bundle suggests installing nelmio/api-doc-bundle (For using the public API methods.)
sonata-project/user-bundle suggests installing sonata-project/seo-bundle (For SEO breadcrumb block service usage)
Writing lock file
Generating autoload files
classification and easy extends are already auto-required by the bundle, so you just actually need to do this : composer require sonata-project/news-bundle sonata-project/doctrine-orm-admin-bundle
UPDATE: here is my PR

Updating Symfony 2 fails with error due to symfony/finder

Performed a standard installation of Symfony and attempted to update using composer update which gives the following error:
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
- symfony/framework-bundle v2.7.9 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found.
- symfony/framework-bundle v2.7.8 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found.
- symfony/framework-bundle v2.7.10 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found.
- symfony/framework-bundle v2.3.38 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found.
- symfony/framework-bundle v2.3.37 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found.
- symfony/framework-bundle v2.3.36 requires symfony/finder ~2.0,>=2.0.5 -> no matching package found.
- Conclusion: remove symfony/symfony v3.0.3
- Conclusion: don't install symfony/symfony v3.0.3
I am unable to add any further libraries as the standard update already fails. Any help is appreciated!
I can't reproduce your bug - update works ok on fresh symfony-standard project
This is result of composer update just after calling composer create-project symfony/framework-standard-edition
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing monolog/monolog (1.17.2)
- Installing monolog/monolog (1.18.0)
Downloading: 100%
- Removing paragonie/random_compat (v1.2.0)
- Installing paragonie/random_compat (v1.2.1)
Downloading: 100%
- Removing symfony/monolog-bundle (v2.8.2)
- Installing symfony/monolog-bundle (v2.9.0)
Downloading: 100%
- Removing sensio/framework-extra-bundle (v3.0.13)
- Installing sensio/framework-extra-bundle (v3.0.14)
Downloading: 100%
Writing lock file
Generating autoload files
What You can do?
Try to clear your composer cache
composer clear-cache

Getting Installation request errors from composer when trying to create a sylius project?

When I try to perform:
composer create-project -s dev sylius/sylius:dev-master
I receive the following error:
Installing sylius/sylius (dev-master 0da3c0022d3118135e56908dfa4c69e6699770ce)
- Installing sylius/sylius (dev-master master)
Cloning master
Created project in sylius
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 fabpot/goutte v1.0.3 -> satisfiable by fabpot/goutte[v1.0.3].
- fabpot/goutte v1.0.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 2
- Installation request for instaclick/php-webdriver 1.0.17 -> satisfiable by instaclick/php-webdriver[1.0.17].
- instaclick/php-webdriver 1.0.17 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 3
- fabpot/goutte v1.0.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- behat/mink-goutte-driver v1.0.9 requires fabpot/goutte ~1.0.1 -> satisfiable by fabpot/goutte[v1.0.3].
- Installation request for behat/mink-goutte-driver v1.0.9 -> satisfiable by behat/mink-goutte-driver[v1.0.9].
This error occurs when you are missing the PHP curl extensions. Some of the sylius dependencies are dependent on that extension.
To solve this error just install and enable the php-curl extension.
With apt-get:
sudo apt-get install php5-curl
Or follow:
http://php.net/manual/en/curl.installation.php
Add minimum-stability option to composer.json file.
{
"require": {
"php-ews/php-ews": "dev-master"
},
"minimum-stability": "dev"
}

Resources