-1

I try to install a specific spreachsheet lib with this command:

composer require phpoffice/phpspreadsheet:1.8.2 (because I have Php5 version)

I have this error :

Your requirements could not be resolved to an installable set of packages.

Problem 1

- symfony/symfony is locked to version v3.4.10 and an update of this package was not requested.

- Only one of these can be installed: symfony/twig-bundle[v3.4.26], symfony/symfony[v3.4.10]. symfony/symfony replaces symfony/twig-bundle and thus cannot coexist with it.

- symfony/twig-bundle is locked to version v3.4.26 and an update of this package was not requested.

my composer.json:

{ "name": "symfony/framework-standard-edition", "license": "MIT", "type": "project", "description": "The "Symfony Standard Edition" distribution", "autoload": { "psr-4": { "": "src/" }, "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] }, "autoload-dev": { "psr-4": { "AppBundle\Tests\": "tests/" }, "files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ] }, "require": { "php": ">=5.5.9", "beberlei/doctrineextensions": "1.1.9", "doctrine/doctrine-bundle": "^1.6", "doctrine/doctrine-migrations-bundle": "^1.3", "doctrine/orm": "^2.5", "incenteev/composer-parameter-handler": "^2.0", "paragonie/random_compat": "~1.3", "phpseclib/phpseclib": "^2.0", "ramsey/uuid": "^3.8", "sensio/distribution-bundle": "^5.0.19", "sensio/framework-extra-bundle": "^5.0.0", "symfony/assetic-bundle": "^2.8", "symfony/monolog-bundle": "^3.1.0", "symfony/polyfill-apcu": "^1.0", "symfony/symfony": "3.4.10", "symfony/translation": "^3.4", "symfony/twig-bundle": "3.4.26", "symfony/validator": "^3.4", "theodo-evolution/legacy-wrapper-bundle": "^1.2", "theodo-evolution/session-bundle": "^1.0", "twig/twig": "^1.0||^2.0" }, "require-dev": { "phpunit/phpunit": "^5.7.27", "sensio/generator-bundle": "^3.0", "symfony/phpunit-bridge": "^3.0" }, "scripts": { "symfony-scripts": [ "Incenteev\ParameterHandler\ScriptHandler::buildParameters", "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap", "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache", "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets", "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile", "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget" ], "post-install-cmd": [ "@symfony-scripts" ], "post-update-cmd": [ "@symfony-scripts" ] }, "config": { "platform": { "php": "5.6" }, "sort-packages": true }, "extra": { "symfony-app-dir": "app", "symfony-bin-dir": "bin", "symfony-var-dir": "var", "symfony-web-dir": "web", "symfony-tests-dir": "tests", "symfony-assets-install": "relative", "incenteev-parameters": { "file": "app/config/parameters.yml" }, "branch-alias": { "dev-master": "3.4-dev" } } }

Someone has an idea please ?

nch
  • 29
  • 4
  • What have you tried so far? Where are you stuck? Also, are you sure this is in any way related to the package you want to add? – Nico Haase Jan 11 '21 at 12:48
  • Hi Nico, I try to install spreadsheet bundle, with command : composer require phpoffice/phpspreadsheet:1.8.2 ... I tried composer install/update, and I got the same error, so it is not related to the package that I want to add – nch Jan 11 '21 at 13:06
  • phpspreadsheet is not a bundle. It is a library. That is not just me being pedantic. phpspreasheet has no symfony dependencies. I don't think those errors are coming from trying to install phpspreadsheet. I don't have a PHP 5.x environment handy but using PHP7.4 I created a fresh Symfony 5.2 project and then installed the library without a problem. Maybe try making a fresh 3.4 project and then install phpspreadsheet without doing anything else and see what happens. – Cerad Jan 11 '21 at 13:23
  • Please add all clarification to your question by editing it. I would assume that the error is related to `symfony/symfony replaces symfony/twig-bundle and thus cannot coexist with it` - as given in the error message itself – Nico Haase Jan 11 '21 at 14:40
  • Thank's for your answers. @NicoHaase, yes but I don't know the origin of this error :/ – nch Jan 11 '21 at 15:03

1 Answers1

0

symfony/symfony is a package that contains all components of the Symfony framework. This also contains symfony/twig-bundle. There's no need to install both of these packages, so you can safely remove symfony/twig-bundle. Afterwards, it should be possible to add whatever package you want to add

Nico Haase
  • 11,420
  • 35
  • 43
  • 69