LoginSignup
0
0

More than 3 years have passed since last update.

DockerのGDがjpegに対応してないので対応する

Posted at

elfinderのリサイズが動かない(ローカル環境にて)

エラーが出る。

Call to undefined function imagecreatefromjpeg() {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to undefined function imagecreatefromjpeg() at /var/www/html/public/js/admin/elfinder/php/elFinderVolumeDriver.class.php:5819)

GDがうまく動いてない模様。

原因

JPEGのサポートが有効になっていないため

解決方法

Dockerfileにて

RUN apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
    && docker-php-ext-install -j$(nproc) iconv \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0