Я пытаюсь получить последнюю версию mPDF для моей недавно обновленной (centos) среды dev php (теперь на php 8.2.10), но получаю следующую ошибку Symfony:
$ composer require mpdf/mpdf
Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony3/Component/Console/Helper/HelperSet.php on line 104
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/share/php/JsonSchema5/Constraints/Constraint.php:48
Deprecation Notice: Return type of Symfony\Component\Process\Process::getIterator($flags = 0) should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony3/Component/Process/Process.php:567
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:799
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:804
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Куда мне с этим идти?
(PS. Я здесь не эксперт по системному администрированию... Я хорошо разрабатываю, но плохо администрирую. Буду благодарен за любую помощь)
Редактировать № 1 — добавлена информация о версии:
$ composer --version
Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony3/Component/Console/Helper/HelperSet.php on line 104
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/share/php/JsonSchema5/Constraints/Constraint.php:48
Deprecation Notice: Return type of Symfony\Component\Process\Process::getIterator($flags = 0) should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony3/Component/Process/Process.php:567
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:799
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in /usr/share/php/Composer/Autoload/AutoloadGenerator.php:804
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]?
Composer 2.1.3 2021-06-09 16:31:20
Привет, Нико! Я обновил вопрос, включив в него информацию о версии.
Что ж, Composer v2.1.3 довольно устарел, как вы видите в информации о дате. Обновите его до любой более актуальной версии, которая также поддерживает PHP 8.2.
Любые предложения, как... composer self-update возвращает (а также все оповещения об устаревании), "Command "self-update" is not defined."
Я понятия не имею, как вы его установили, но на StackOverflow уже есть другие вопросы об этой конкретной ошибке.
Хорошо, я думаю, что обновил композитор: 1) php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 2) php composer-setup.php 3) mv composer.phar /usr/bin/composer 4) composer ... теперь дает Composer 2.6.3. Теперь это позволило мне запускать composer require mpdf/mpdf без ошибок. Спасибо, Нико, за подталкивание в правильном направлении.






Хорошо, с помощью Нико я обновил композитор, а затем обновил mPDF.
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php composer-setup.php
$ mv composer.phar /usr/bin/composer
$ composer --version
$ composer require mpdf/mpdf
Какую версию Composer вы используете? И еще, о какой ошибке вы говорите? Вывод, которым вы поделились, не содержит ни одного сообщения об ошибке.