composer-phpsymfony4mime-typesmime

Composer installation failed


While running the Pimcore6.9 along with the symfony4.4 I had spotted some warnings:

The MimetypeGuesser is depricated since symfony4.3 use MimeTypes instead.

composer show -i 

does not show any mime Package at all, so in order to get rid of this warnings I would like to install the package as proposed:

   composer require symfony/mime

But I get this:

  Using version ^5.2 for symfony/mime
./composer.json has been updated
Running composer update symfony/mime
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires symfony/mime ^5.2, found symfony/mime[v5.2.0, ..., v5.2.9] but these were not loaded, likely because it conflicts with another require.

composer.json

 {
  "name": "pimcore/skeleton",
  "type": "project",
  "license": "GPL-3.0-or-later",
  "config": {
    "optimize-autoloader": true,
    "sort-packages": true
  },
  "require": {
    "php": ">=7.2",
    "pimcore/pimcore": "~6.9.0"
  },
  "require-dev": {
    "cache/integration-tests": "^0.16.0",
    "codeception/codeception": "~2.4.5"
  },
  "autoload": {
    "psr-4": {
      "": ["src/"],
      "Pimcore\\Model\\DataObject\\": "var/classes/DataObject",
      "Pimcore\\Model\\Object\\": "var/classes/Object",
      "Website\\": "legacy/website/lib"
    },
    "classmap": [
      "app/AppKernel.php"
    ]
  },
  "scripts": {
    "post-create-project-cmd": "Pimcore\\Composer::postCreateProject",
    "post-install-cmd": [
      "Pimcore\\Composer::postInstall",
      "@pimcore-scripts"
    ],
    "post-update-cmd": [
      "Pimcore\\Composer::postUpdate",
      "@pimcore-scripts",
      "Pimcore\\Composer::executeMigrationsUp",
      "@pimcore-scripts"
    ],
    "pimcore-scripts": [
      "Pimcore\\Composer::clearCache",
      "Pimcore\\Composer::installAssets"
    ]
  },
  "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"
  }
}

and within pimcore

{
  "name": "pimcore/pimcore",
  "type": "library",
  "description": "Content & Product Management Framework (CMS/PIM/E-Commerce)",
  "keywords": [
    "CMS",
    "PIM",
    "DAM",
    "E-Commerce",
    "RAD",
    "Product Information Management"
  ],
  "homepage": "http://www.pimcore.org/",
  "license": "GPL-3.0-or-later",
  "authors": [
    {
      "name": "pimcore Team",
      "email": "info@pimcore.com",
      "homepage": "http://www.pimcore.org/",
      "role": "Developer"
    }
  ],
  "support": {
    "issues": "https://github.com/pimcore/pimcore/issues",
    "wiki": "https://pimcore.com/docs/latest/",
    "source": "https://github.com/pimcore/pimcore",
    "forum": "https://talk.pimcore.org/",
    "docs": "https://pimcore.com/docs/latest/"
  },
  "require": {
    "php": ">=7.2",
    "ext-SimpleXML": "*",
    "ext-dom": "*",
    "ext-exif": "*",
    "ext-fileinfo": "*",
    "ext-gd": "*",
    "ext-intl": "*",
    "ext-iconv": "*",
    "ext-mbstring": "*",
    "ext-mysqli": "*",
    "ext-pdo_mysql": "*",
    "ext-zip": "*",
    "ext-zlib": "*",
    "psr/simple-cache": "^1.0.0",
    "amnuts/opcache-gui": "^3.0.1",
    "cache/tag-interop": "^1",
    "cbschuld/browser.php": "^1.9.6",
    "colinmollenhour/credis": "^1.10.0",
    "composer/ca-bundle": "^1",
    "defuse/php-encryption": "^2.2.0",
    "doctrine/annotations": "^1.6.0",
    "doctrine/collections": "^1.5.0",
    "doctrine/common": "^2.13.0",
    "doctrine/dbal": "^2.8.0",
    "doctrine/doctrine-bundle": "^1.9.1",
    "doctrine/doctrine-migrations-bundle": "^1.3.1",
    "doctrine/inflector": "^1.4.0 || ^2.0.0",
    "egulias/email-validator": "^2.1.5",
    "endroid/qr-code": "^3.4.4",
    "friendsofsymfony/jsrouting-bundle": "^2.5",
    "geoip2/geoip2": "^2.9",
    "google/apiclient": "^2.0",
    "guzzlehttp/guzzle": "^6.3",
    "http-interop/http-factory-guzzle": "^1.0.0",
    "hybridauth/hybridauth": "^2.12",
    "lcobucci/jwt": "^3.2",
    "league/csv": "^9.1",
    "linfo/linfo": "^4.0.0",
    "mjaschen/phpgeo": "^2.0",
    "mpratt/embera": "^2.0.3",
    "myclabs/deep-copy": "^1.3",
    "neitanod/forceutf8": "^2.0.4",
    "nesbot/carbon": "^1.34.0 || ^2.11.0",
    "ocramius/package-versions": "^1.2",
    "pear/net_url2": "^2.2",
    "phive/twig-extensions-deferred": "^2.0",
    "piwik/device-detector": "^3.9",
    "presta/sitemap-bundle": "^1.7 || ^2.1",
    "ramsey/uuid": "^3.8",
    "sabre/dav": "^3.2",
    "sensio/framework-extra-bundle": "^5.4",
    "sensiolabs/ansi-to-html": "^1.1",
    "symfony-cmf/routing-bundle": "^2.0",
    "symfony/contracts": "^1.1",
    "symfony/monolog-bundle": "^3.1.0",
    "symfony/swiftmailer-bundle": "^3.2.2",
    "symfony/symfony": "^3.4.26 || ^4.1.12",
    "tijsverkoyen/css-to-inline-styles": "^2.2.1",
    "twig/extensions": "^1.5",
    "twig/twig": "^2.4",
    "umpirsky/country-list": "^2.0.4",
    "vrana/adminer": "^4.8.0",
    "vrana/jush": "~2.0.2",
    "zendframework/zend-paginator": "^2.7",
    "zendframework/zend-servicemanager": "^3.2",
    "scheb/two-factor-bundle": "^3.26",
    "phpoffice/phpspreadsheet": "^1.9",
    "html2text/html2text": "^4.2.1",
    "webmozarts/console-parallelization": "^1.1.0",
    "knplabs/knp-paginator-bundle": "^4.1.1"
  },
  "conflict": {
    "doctrine/dbal": "^2.13.0",
    "monolog/monolog": ">=2",
    "phpstan/phpstan": "0.12.55",
    "symfony/symfony": "3.4.43 || 4.4.11",
    "symfony/monolog-bundle": "3.6.0"
  },
  "require-dev": {
    "cache/integration-tests": "^0.16.0",
    "codeception/codeception": "~2.4.5",
    "phpstan/phpstan": "^0.12.26",
    "phpstan/phpstan-symfony": "^0.12",
    "heidelpay/heidelpay-php": "^1.2.5.1",
    "klarna/checkout": "^3.0.0",
    "elasticsearch/elasticsearch": "^6 || ^7",
    "paypal/paypal-checkout-sdk": "^1",
    "mpay24/mpay24-php": "^4.2",
    "composer/composer": "*"
  },
  "suggest": {
    "ext-curl": "*",
    "ext-imagick": "*",
    "ext-redis": "*",
    "heidelpay/heidelpay-php": "Required for Heidelpay payment",
    "klarna/checkout": "Required for Klarna payment",
    "elasticsearch/elasticsearch": "Required for Elastic Search service",
    "paypal/paypal-checkout-sdk": "Required for Paypal payment",
    "mpay24/mpay24-php": "Required for MPay24 payment"
  },
  "autoload": {
    "files": [
      "lib/helper-functions.php",
      "lib/simple_html_dom.php"
    ],
    "psr-4": {
      "Pimcore\\Model\\": "models",
      "Pimcore\\": "lib",
      "Pimcore\\Bundle\\": "bundles"
    },
    "classmap": [
      "lib/Pimcore.php"
    ],
    "exclude-from-classmap": [
      "lib/compatibility-stubs.php",
      "lib/Pimcore/Bundle/EcommerceFrameworkBundle/config/namespace_compatibility.php"
    ]
  },
  "autoload-dev": {
    "psr-4": {
      "Pimcore\\Tests\\": "tests"
    },
    "files": [
      "app/AppKernel.php"
    ]
  },
  "scripts": {
    "post-create-project-cmd": "Pimcore\\Composer::postCreateProject",
    "post-install-cmd": [
      "Pimcore\\Composer::postInstall",
      "@pimcore-scripts"
    ],
    "post-update-cmd": [
      "Pimcore\\Composer::postUpdate",
      "@pimcore-scripts",
      "Pimcore\\Composer::executeMigrationsUp"
    ],
    "pimcore-scripts": [
      "Pimcore\\Composer::clearCache",
      "Pimcore\\Composer::installAssets"
    ]
  },
  "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"
  },
  "bin": ["bin/pimcore-install"],
  "config": {
    "preferred-install": {
      "symfony/symfony": "source"
    }
  }
}

Regarding this issue I would to ask two questions:

  1. How to install this package ?

  2. How to check which package is preventing the installation and why?


Solution

  • Your composer.json already lists symfony/symfony as a required package. This contains symfony/mime - as long as you are using Symfony v4.3 or later. The MIME component did not exist before that.