docker compose run --rm php-webp php -r "print_r(gd_info());"
Array
(
[GD Version] => bundled (2.1.0 compatible)
[FreeType Support] => 1
[FreeType Linkage] => with freetype
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPEG Support] => 1
[PNG Support] => 1
[WBMP Support] => 1
[XPM Support] =>
[XBM Support] => 1
[WebP Support] => 1
[BMP Support] => 1
[AVIF Support] =>
[TGA Read Support] => 1
[JIS-mapped Japanese Font Support] =>
)
docker compose run --rm php-webp php -r "if (function_exists('imagewebp')) { echo 'yes';} else {echo 'no';}"
> yes
try {
} catch (Exception $exception) {
Yii::$app->session->setFlash('error', $exception->getMessage());
return $this->redirect('index')
}
Если Вы установили в одном контейнере gd, а вызываете в другом, то будет ошибка, что такой функции нет.