Troubles with Docker + PHP7 + GD resulting in “Call to undefined function imagecreatefromjpeg()”

后端 未结 2 1317
故里飘歌
故里飘歌 2020-12-28 14:07

I\'m having troubles when trying to create an image using imagecreatefromjpeg using this Dockerfile to generate the container:

FROM          


        
2条回答
  •  礼貌的吻别
    2020-12-28 14:45

    For PHP 5.6

    FROM php:5.6-apache
    
    RUN apt-get update && apt-get install -y \ 
    libfreetype6-dev libjpeg62-turbo-dev \ 
    libgd-dev libpng12-dev
    RUN docker-php-ext-configure gd \ 
    --with-freetype-dir=/usr/include/ \ 
    --with-jpeg-dir=/usr/include/
    RUN docker-php-ext-install gd
    

    If still not working, can re-install the container.

    docker rm  
    docker-compose build --pull
    docker-compose up
    

提交回复
热议问题