1

I am upgrading a site from Craft CMS 3 to 4. I develop the site on ddev with docker desktop on Windows.

When running composer update on PHP 7.4 and docker 2 on ddev the following happens:

$ ddev composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
 
  Problem 1
    - embed/embed[v4.0.0, ..., v4.2.7] require php ^7.4 -> your php version (8.0.28) does not satisfy that requirement.
    - Root composer.json requires newism/craft3-fields ^2.0.0 -> satisfiable by newism/craft3-fields[2.0.0].
    - newism/craft3-fields 2.0.0 requires embed/embed ^4.0 -> satisfiable by embed/embed[v4.0.0, ..., v4.4.8].
    - You can only install one version of a package, so only one of these can be installed: embed/embed[3.4.17, v3.4.18, v4.0.0, ..., v4.4.8].
    - spicyweb/craft-embedded-assets 3.1.5 requires embed/embed ^3.4.17 -> satisfiable by embed/embed[3.4.17, v3.4.18].
    - Root composer.json requires spicyweb/craft-embedded-assets ^3.1.5 -> satisfiable by spicyweb/craft-embedded-assets[3.1.5].

If I modify config.yaml to use PHP 8, I get the following error:

$ ddev composer update
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 born05/craft-twofactorauthentication ^3.2.0 -> satisfiable by born05/craft-twofactorauthentication[3.2.0].
    - born05/craft-twofactorauthentication 3.2.0 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires craftcms/aws-s3 ^2.0.3 -> satisfiable by craftcms/aws-s3[2.0.3].
    - craftcms/aws-s3 2.0.3 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 3
    - Root composer.json requires craftcms/ckeditor ^3.4.0 -> satisfiable by craftcms/ckeditor[3.4.0].
    - craftcms/ckeditor 3.4.0 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 4
    - Root composer.json requires craftcms/commerce ^4.2.10 -> satisfiable by craftcms/commerce[4.2.10].
    - craftcms/commerce 4.2.10 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 5
    - Root composer.json requires craftcms/feed-me ^5.1.3.1 -> satisfiable by craftcms/feed-me[5.1.3.1].
    - craftcms/feed-me 5.1.3.1 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 6
    - Root composer.json requires craftcms/redactor ^3.0.4 -> satisfiable by craftcms/redactor[3.0.4].
    - craftcms/redactor 3.0.4 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 7
    - Root composer.json requires craftcms/webhooks ^3.0.4 -> satisfiable by craftcms/webhooks[3.0.4].
    - craftcms/webhooks 3.0.4 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 8
    - Root composer.json requires nystudio107/craft-seomatic ^4.0.27 -> satisfiable by nystudio107/craft-seomatic[4.0.27].
    - nystudio107/craft-seomatic 4.0.27 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 9
    - Root composer.json requires putyourlightson/craft-blitz ^4.4.5 -> satisfiable by putyourlightson/craft-blitz[4.4.5].
    - putyourlightson/craft-blitz 4.4.5 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 10
    - Root composer.json requires sebastianlenz/linkfield ^2.1.5 -> satisfiable by sebastianlenz/linkfield[2.1.5].
    - sebastianlenz/linkfield 2.1.5 requires php ^8.0 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 11
    - Root composer.json requires spacecatninja/imager-x ^4.1.13 -> satisfiable by spacecatninja/imager-x[4.1.13].
    - spacecatninja/imager-x 4.1.13 requires php ^8.0 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 12
    - Root composer.json requires spicyweb/craft-embedded-assets ^3.1.5 -> satisfiable by spicyweb/craft-embedded-assets[3.1.5].
    - spicyweb/craft-embedded-assets 3.1.5 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 13
    - Root composer.json requires spicyweb/craft-neo ^3.7.9 -> satisfiable by spicyweb/craft-neo[3.7.9].
    - spicyweb/craft-neo 3.7.9 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 14
    - Root composer.json requires trendyminds/algolia ^4.0.0 -> satisfiable by trendyminds/algolia[4.0.0].
    - trendyminds/algolia 4.0.0 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 15
    - Root composer.json requires ttempleton/craft-category-groups-field ^2.0.1 -> satisfiable by ttempleton/craft-category-groups-field[2.0.1].
    - ttempleton/craft-category-groups-field 2.0.1 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 16
    - Root composer.json requires venveo/craft-bulkedit ^4.0.1 -> satisfiable by venveo/craft-bulkedit[4.0.1].
    - venveo/craft-bulkedit 4.0.1 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 17
    - Root composer.json requires verbb/cloner ^2.0.3 -> satisfiable by verbb/cloner[2.0.3].
    - verbb/cloner 2.0.3 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 18
    - Root composer.json requires verbb/formie ^2.0.30 -> satisfiable by verbb/formie[2.0.30].
    - verbb/formie 2.0.30 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 19
    - Root composer.json requires verbb/navigation ^2.0.18 -> satisfiable by verbb/navigation[2.0.18].
    - verbb/navigation 2.0.18 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 20
    - Root composer.json requires verbb/super-table ^3.0.9 -> satisfiable by verbb/super-table[3.0.9].
    - verbb/super-table 3.0.9 requires php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
  Problem 21
    - craftcms/cms[4.0.0, ..., 4.4.13] require php ^8.0.2 -> your php version (7.4.33) does not satisfy that requirement.
    - Root composer.json requires craftcms/cms ^4.0.0 -> satisfiable by craftcms/cms[4.0.0, ..., 4.4.13].
 

So it seems embed/embed requires PHP ^7.4 to update, while the other packages require 8.0. How can I approach this? Or am I interpreting the error wrong?

1 Answer 1

4

The package embed/embed isn't the problem – the newest version supports both PHP 7.4 and 8+. The problem is that you have two plugins that require different versions of that package:

  • newism/craft3-fields 2.0.0 requires embed/embed ^4.0
  • spicyweb/craft-embedded-assets 3.1.5 requires embed/embed ^3.4.17

The first plugin requires version ^4.0, the second version ^3.4.17. Those requirements aren't compatible, since you can only have one version of that library in your project.

The best solution would be to get the author of the second plugin to update their plugin to require version ^4.0 as well. There's already an open issue on this topic: https://github.com/spicywebau/craft-embedded-assets/issues/152
I suggest you upvote this issue and post a comment explaining your situation to let the author know why this is important. You could also try to update the plugin yourself and open a pull request.

If you can't wait for the author to update the plugin, you have two options:

  • Fork the plugin and update it to support embed/embed in version ^4.0. I don't recommend this as it places additional maintenance burden on your project.
  • Remove one of the two plugins to avoid the version conflict.
1
  • 1
    Very clarifying answer. Thanks. I will remove whichever one causes the least pain.
    – nitech
    Commented Jun 6, 2023 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.