mstdmstd
1 month ago
888
7
General

Adding imagick to my docker LAMP I got error :You should add “extension=imagick.so” to php.ini

Posted 1 month ago by mstdmstd

Hello, Adding imagick to my docker LAMP installation I got error

Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so'
Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.4.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
/bin/sh: 1: imagick: not found
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install -y     python     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     libzip-dev     nano     mc     git-core     libmagickwand-dev --no-install-recommends &&     pecl install imagick && imagick &&     docker-php-ext-enable imagick &&     curl     build-essential     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     locate     && git clone https://github.com/nodejs/node.git     && cd node     && git checkout v12.0.0     && ./configure      && make      && make install' returned a non-zero code: 127

In Dockerfile.yml I added lines for imagick :

FROM php:7.3-apache

RUN apt-get update && \
    apt-get install -y \
    python \
    libfreetype6-dev \
    libwebp-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libzip-dev \
    nano \
    mc \
    git-core \

    # I added these lines
    libmagickwand-dev --no-install-recommends && \
    pecl install imagick && imagick && \
    docker-php-ext-enable imagick && \

    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    locate \
    # composer \
    && git clone https://github.com/nodejs/node.git \
    && cd node \
    && git checkout v12.0.0 \
    && ./configure \
     && make \
     && make install

  RUN npm install cross-env

  RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/


  # Install Composer
  RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

  RUN  docker-php-ext-install gd pdo pdo_mysql zip gmp bcmath pcntl ldap sysvmsg exif  \
&& a2enmod rewrite

  # I added this line
  RUN install-php-extensions imagick

COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

Which options did I miss ?

Please sign in or create an account to participate in this conversation.