Skip to content

Commit

Permalink
Fix Imagick for PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpolito committed Oct 29, 2024
1 parent e225271 commit 1a40090
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
10 changes: 8 additions & 2 deletions 8.3-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ RUN adduser -D -u 1337 kool \
mysqli \
ftp \
&& pecl install redis \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& mkdir /tmp/imagick && cd /tmp/imagick \
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure --with-webp=yes \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
# composer
Expand Down
10 changes: 8 additions & 2 deletions 8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ RUN adduser -D -u 1337 kool \
&& pecl install redis \
&& pecl install xdebug \
&& pecl install pcov && docker-php-ext-enable pcov \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& mkdir /tmp/imagick && cd /tmp/imagick \
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure --with-webp=yes \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
# composer
Expand Down
11 changes: 11 additions & 0 deletions template/Dockerfile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,19 @@
&& pecl install {{ version_compare($version, '8', '>=') ? 'xdebug' : 'xdebug-3.1.6' }} \
&& pecl install pcov && docker-php-ext-enable pcov \
@endif
@if (version_compare($version, '8.2', '<='))
&& pecl install imagick \
&& docker-php-ext-enable imagick \
@else
&& mkdir /tmp/imagick && cd /tmp/imagick \
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
&& phpize \
&& ./configure --with-webp=yes \
&& make \
&& make install \
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
@endif
&& docker-php-ext-enable redis \
&& cp "/usr/local/etc/php/php.ini-{{ $prod ? 'production' : 'development' }}" "/usr/local/etc/php/php.ini" \
# composer
Expand Down

0 comments on commit 1a40090

Please sign in to comment.