Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Trying to install this module on php 8.1 there's the following error:
Problem 1
- Root composer.json requires drupal/media_thumbnails_video ^1.0@beta -> satisfiable by drupal/media_thumbnails_video[1.0.0-beta1].
- drupal/media_thumbnails_video 1.0.0-beta1 requires php-ffmpeg/php-ffmpeg ^0.14.0 -> found php-ffmpeg/php-ffmpeg[v0.14] but it conflicts with your root composer.json require (^1.0).
Problem 2
- php-ffmpeg/php-ffmpeg v1.x-dev requires php ^7.1 -> your php version (8.1.3) does not satisfy that requirement.
- php-ffmpeg/php-ffmpeg[v1.0.0, ..., v1.0.1] require symfony/process ^5.4 || ^6.0 -> found symfony/process[v5.4.0-BETA1, ..., 5.4.x-dev, v6.0.0-BETA1, ..., 6.1.x-dev] but the package is fixed to v4.4.35 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires php-ffmpeg/php-ffmpeg ^1.0 -> satisfiable by php-ffmpeg/php-ffmpeg[v1.0.0, v1.0.1, v1.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require drupal/media_thumbnails_video:*" to figure out if any version is installable, or "composer require drupal/media_thumbnails_video:^2.1" if you know which you need.
The version 1.0.0 onwards of phpffmpeg support php 8.0.
Unfortunately,
composer require php-ffmpeg/php-ffmpeg:1.0.0
gives this other error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires php-ffmpeg/php-ffmpeg 1.0.0 -> satisfiable by php-ffmpeg/php-ffmpeg[v1.0.0].
- php-ffmpeg/php-ffmpeg v1.0.0 requires symfony/process ^5.4 || ^6.0 -> found symfony/process[v5.4.0-BETA1, ..., 5.4.x-dev, v6.0.0-BETA1, ..., 6.1.x-dev] but the package is fixed to v4.4.35 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Drupal 9.x is fixed with symfony/process 4.x, so I don't know if it is possible to install the module at all with php8.x
Comment | File | Size | Author |
---|---|---|---|
#7 | media_thumbnails_video-3274875-7.patch | 303 bytes | lamp5 |
Comments
Comment #2
lamp5We do not lock any fixed version of php-ffmpeg library so lets try to
composer update drupal/media_thumbnails_video --with-all-dependencies
or try to remove vendor directory and composer.lock file. Then try to reinstall all project using
composer install
Note.
Only https://packagist.org/packages/php-ffmpeg/php-ffmpeg#v1.0.1 requires and locks php version to 8.0+
Comment #3
Giuseppe87 CreditAttribution: Giuseppe87 commented-
Comment #4
Giuseppe87 CreditAttribution: Giuseppe87 commentedSorry but they don't seems to work:
1.
composer require drupal/media_thumbnails_video --with-all-dependencies
doesn't work:2. Removing composer.lock and vendor even in the case would work would also potentially update any other packages in the composer.json. In my opnion, this is too risky to do with a site already in production.
I've seen that PHP-FFMpeg/PHP-FFMpeg v. 0.19.0 added the support to php 8.1 without locking yet symfony/process to ^5|^6, so I tried:
composer require php-ffmpeg/php-ffmpeg:0.19.0
which works.
However, after that:
still gives errors:
And this is weird, I don't understand why the conflict at this point, as 0.19.0 should satisfy the "^0.14.0" requirement of the module
Comment #5
lamp5Lets try to remove media_thumbnails_video and php-ffmpeg from your composer then try to re-add media_thumbnails_video. It is fresh project launched on php 8 or migrated from other php version / from other repository ?
Comment #6
Giuseppe87 CreditAttribution: Giuseppe87 commentedThe site is an installation which started directly with 9.3.x and php 8.0. It switched after some time to php 8.1.
It has already a good deal of other modules\requirements - e.g. commerce.
However I can reproduce the exact behaviors with a 9.3.x fresh installation - using
drupal/recommended-project
- with php 8.1 and literally nothing else.Comment #7
lamp5Comment #8
lamp5It looks like build works so it should fixes this issue.
Comment #9
quimic@lamp5
In order to apply a patch via composer using cweagans/composer-patches, the module needs to be considered installable by composer first.
Composer first checks which packages to install, then applies patches.
Since it cannot find a suitable list of packages to install, it fails, and the patch is never applied.
See this excerpt from cweagans/composer-patches README:
Comment #10
lamp5Yes. I know. It is the reason why I launched test build with php8.
Comment #12
lamp5Please test this module on php8, I set status to active to a future fixes if needed.
Comment #13
quimicI confirm that the dev version of the module can be installed fine now (using php-ffmpeg v0.19 in my case). Haven't tested functionality yet.
Comment #14
lamp5Please test, I am waiting for feedback.
Comment #15
quimic@lamp5
It is difficult because I have never used the module before.
Wether or not I install the module, I see a thumbnail image for my remote video media. I cannot see any difference with/without the module.
The thumnail image is 480px wide, not the specified width in Media Thumbnails configuration, even if I use the Refresh button.
Comment #16
lamp5This module generates thumbnails for local mp4 videos, not remote videos.
Comment #17
quimicSorry I misunderstood the purpose of the module. I am unable to test functionality then.
All I can say is that it installs fine using PHP 8.0 now.
Comment #18
Giuseppe87 CreditAttribution: Giuseppe87 commentedThanks for the quick update.
From my test, the module now installs and works on php 8.1.
Comment #19
dtarc CreditAttribution: dtarc at Affinity Bridge commentedI've tested with php-ffmpeg 0.19.0 and I'm getting the following error:
Same error as https://www.drupal.org/project/media_thumbnails_video/issues/3182350
Comment #20
lamp5So lets update your php-ffmpeg library.
Comment #21
dtarc CreditAttribution: dtarc at Affinity Bridge commentedOk. It's on 0.19.0. What should it be on?
Comment #22
alfattal CreditAttribution: alfattal as a volunteer commentedI tried this and the installation was successful:
composer require "php-ffmpeg/php-ffmpeg:^0.19.0" -W
This updated the PHP-FFMpeg/PHP-FFMpeg dependencies
Then, I installed the dev version and it worked just fine
composer require 'drupal/media_thumbnails_video:1.x-dev@dev'
I'm on Drupal 9.4.5 and PHP 8.0
Comment #23
AnybodySo this seems fixes then based on the feedback from #22?
Comment #24
himanshu_sindhwani CreditAttribution: himanshu_sindhwani for Drupal India Association commentedCan we please update the installation instructions @lamp5 for drupal 9 and php 8. It will save time. I got the same issue and after an hour of work around found this thread.
Installation using composer:
composer require drupal/media_thumbnails_video
Comment #25
lamp5I was testing latest dev version with php 8.1 and works perfect. @himanshu_sindhwani there is no any special steps to upgrade this module.