That seems to solve it. Thanks!
Somehow the extension is not loaded though.
only if I do it this way:
RUN apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* &&
curl -L https://pecl.php.net/get/imagick-3.3.0RC2.tgz >> /usr/src/php/ext/imagick.tgz &&
tar -xf /usr/src/php/ext/imagick.tgz -C /usr/src/php/ext/ &&
rm /usr/src/php/ext/imagick.tgz
RUN docker-php-ext-install imagick-3.3.0RC2
I’ve added imagick.so to the php.ini file, but that didn’t seem to work.
Does docker-php-ext-install do something extra besides creating a .ini file?
Yes, that would be
ini=«/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini« | |
for module in modules/*.so; do | |
if [ -f «$module« ]; then | |
if grep -q zend_extension_entry «$module«; then | |
# https://wiki.php.net/internals/extensions#loading_zend_extensions | |
line=«zend_extension=$(basename «$module«)« | |
else | |
line=«extension=$(basename «$module«)« | |
fi | |
if ! grep -q «$line« «$ini« 2>/dev/null; then | |
echo «$line« >> «$ini« | |
fi | |
fi | |
done |
(which isn’t perfect, but it works OK).
So, you probably just need to add something like this:
RUN echo 'extension=rmagick.so' > /usr/local/etc/php/conf.d/ext-rmagick.ini
I’ve contemplated adding a docker-php-ext-enable
, but I’m not sure whether that’d really be useful since it’s essentially just that one-liner. Perhaps our docs section about how to use docker-php-ext-install
should be followed by a section about how to use PECL appropriately instead. 👍
I had troubles getting this to work. In the end I found the following snipplet used by a WordPress Dockerfile that did work.
RUN apt-get update && apt-get install -y libmagickwand-6.q16-dev --no-install-recommends && ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/MagickWand-config /usr/bin && pecl install imagick && echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini
If this could be abstracted away into am docker-php-ext-install imagemagick
that would be awesome! Not sure how the mechanism works though.
It’s worth pointing out here that #122 did add docker-php-ext-enable
and that imagick
has been updated, so I’ve just tested the following Dockerfile
to be working successfully:
FROM php:5 RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* RUN pecl install imagick && docker-php-ext-enable imagick
root@f1a53d21c435:/# php -i | grep magic Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini libmagic => 517 imagick imagick module => enabled imagick module version => 3.3.0 imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel Imagick compiled with ImageMagick version => ImageMagick 6.8.9-9 Q16 x86_64 2015-01-05 http://www.imagemagick.org Imagick using ImageMagick library version => ImageMagick 6.8.9-9 Q16 x86_64 2015-01-05 http://www.imagemagick.org imagick.locale_fix => 0 => 0 imagick.progress_monitor => 0 => 0 imagick.skip_version_check => 0 => 0
Is installing imagick
on PHP 7 not possible?
7.0.0
FROM php:7.0.0-fpm
# Install Imagick.
RUN apt-get-update && apt-get install -y
libmagickwand-dev
RUN pecl install imagick
RUN docker-php-ext-enable imagick
---> Running in 793875575c01
pecl/imagick is not compatible with PHP version 7.0.0
No valid packages found
install failed
Removing intermediate container 793875575c01
7.0.3
FROM php:7.0.3-fpm
# Install Imagick.
RUN apt-get-update && apt-get install -y
libmagickwand-dev
RUN pecl install imagick
RUN docker-php-ext-enable imagick
Step 5 : RUN pecl install imagick
---> Running in ee9f8c037810
pecl/imagick requires PHP (version >= 5.1.3, version <= 7.0.0, excluded versions: 7.0.0), installed version is 7.0.3
No valid packages found
install failed
Removing intermediate container ee9f8c037810
There’s a 3.4.1 release of imagick now which seems to work fine with PHP7. I was able to install it with
FROM php:7.0.3-fpm
RUN apt-get update
&& apt-get -y install
libmagickwand-dev
--no-install-recommends
&& pecl install imagick
&& docker-php-ext-enable imagick
&& rm -r /var/lib/apt/lists/*
I’m trying this on Alpine Linux and it doesn’t work 😢
FROM php:7.0-fpm-alpine
RUN apk add --update imagemagick-dev
&& pecl install imagick
&& docker-php-ext-enable imagick
Have you a solution for Alpine Linux ?
@fgirardey, did you also apk add --no-cache
any other dependencies? The alpine variant is kept extremely minimal, so you would need to add in any tools like autoconf or a C compiler. I think the full set you would need is:
$ apk add --no-cache autoconf gcc g++ imagemagick-dev libtool make
To save final image space, you should also be able to remove most of them in the same RUN
once the extension is compiled.
@yosifkit it absolutely solved my problem 😊
my finale image is like that :
FROM php:7.0-fpm-alpine
MAINTAINER Florian GIRARDEY <fgirardey@groupeforum.pro>
RUN apk add --update freetype-dev libpng-dev libjpeg-turbo-dev libxml2-dev autoconf g++ imagemagick-dev libtool make
&& docker-php-ext-install gd
&& docker-php-ext-configure gd
--with-gd
--with-freetype-dir=/usr/include/
--with-png-dir=/usr/include/
--with-jpeg-dir=/usr/include/
&& docker-php-ext-install mbstring
&& docker-php-ext-install mysqli
&& docker-php-ext-install opcache
&& docker-php-ext-install soap
&& pecl install imagick
&& docker-php-ext-enable imagick
&& apk del autoconf g++ libtool make
&& rm -rf /tmp/* /var/cache/apk/*
@fgirardey You want to run docker-php-ext-install gd
after you ran docker-php-ext-configure gd …
.
@franz-josef-kaiser Oh yeah you are right, it wasn’t working.
Now it seems to be better, thanks a lot :
FROM php:7.0-fpm-alpine
MAINTAINER Florian GIRARDEY <fgirardey@groupeforum.pro>
# install the PHP extensions we need
RUN apk add --update freetype-dev libpng-dev libjpeg-turbo-dev libxml2-dev autoconf g++ imagemagick-dev libtool make
&& docker-php-ext-configure gd
--with-gd
--with-freetype-dir=/usr/include/
--with-png-dir=/usr/include/
--with-jpeg-dir=/usr/include/
&& docker-php-ext-install gd
&& docker-php-ext-install mbstring
&& docker-php-ext-install mysqli
&& docker-php-ext-install opcache
&& docker-php-ext-install soap
&& pecl install imagick
&& docker-php-ext-enable imagick
&& apk del autoconf g++ libtool make
&& rm -rf /tmp/* /var/cache/apk/*
vasiliyb and skjnldsv reacted with hooray emoji
I use this way to install imagick
for php:5
and other solution not work for me!
FROM php:5.6-apache
MAINTAINER Ali Mihandoost <i@ali.md>
COPY . /var/www/html/
RUN apt-get update
&& DEBIAN_FRONTEND=noninteractive apt-get install -y php5-imagick --no-install-recommends
&& php5enmod imagick
&& rm -rf /var/lib/apt/lists/*
@AliMD, I am hesitant to recommend that way, since the php5-imagick
package from Debian may not work with the version of PHP that the container has.
I would highly recommend against using Debian-packaged PHP bits with this image — we don’t provide the bits dpkg
needs to know which version of PHP we’ve included, so it will likely end up pulling in Debian’s php
packages (which will either shadow the PHP we’ve installed or be ignored due to ours taking precedence).
I’ve just tested the following for installing imagick
with php:5.6-apache
successfully:
FROM php:5.6-apache RUN apt-get update && apt-get install -y --no-install-recommends libmagickwand-dev && rm -rf /var/lib/apt/lists/* RUN pecl install imagick-3.4.1 && docker-php-ext-enable imagick
And again, with Alpine and PHP 7, for good measure:
FROM php:7-alpine RUN set -x && apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS imagemagick-dev libtool && pecl install imagick-3.4.1 && docker-php-ext-enable imagick && apk add --no-cache --virtual .imagick-runtime-deps imagemagick && apk del .phpize-deps
johnnywidth, daohoangson, StalkAlex, SG5, ramsaybell, franz-josef-kaiser, ichsarut, and maks-rafalko reacted with hooray emoji
maks-rafalko reacted with heart emoji
maks-rafalko reacted with rocket emoji
Closing, given that the original issue appears to be fully resolved.
ProTip: Remember to export PHP’s CFLAGS/CPPFLAGS/LDFLAGS before installing imagick-3.4.1
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS"
Otherwise improved ASLR and optimizations are not taken in count by the extension and therefore makes hardened PHP less safer than it should be.
@pwnsdx Better press Y
when you want to link to some file. This gives you the exact commit as reference – else you are linking to a maybe moving target.
carlosreig
added a commit
to carlosreig/docker-lamp
that referenced
this issue
Feb 17, 2017
For PHP 7.1 you need imagick-3.4.3
.
https://bugs.php.net/bug.php?id=72311
FROM php:7.1-fpm-alpine RUN set -ex && apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS imagemagick-dev libtool && export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && pecl install imagick-3.4.3 && docker-php-ext-enable imagick && apk add --no-cache --virtual .imagick-runtime-deps imagemagick && apk del .phpize-deps
king724 and mendesalan reacted with hooray emoji
balakrishnangithub
added a commit
to balakrishnangithub/docker-php-apache
that referenced
this issue
Jun 1, 2017
krisanalfa, bocharsky-bw, jan-krueger, and ichsarut reacted with hooray emoji
Its works for me too … on php 7.2
FROM php:7.2-fpm
RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS"
&& apt-get update
&& apt-get install -y --no-install-recommends
libmagickwand-dev
&& rm -rf /var/lib/apt/lists/*
&& pecl install imagick-3.4.3
&& docker-php-ext-enable imagick
Can confirm @heygrady solution worked for me on php:7.2-alpine3.8
.
Has anyone experience with php:7.2-apache
I tried the following
RUN export CFLAGS=»$PHP_CFLAGS» CPPFLAGS=»$PHP_CPPFLAGS» LDFLAGS=»$PHP_LDFLAGS»
&& apt-get update
&& apt-get install -y —no-install-recommends
libmagickwand-dev
&& rm -rf /var/lib/apt/lists/*
&& pecl install imagick-3.4.3
&& docker-php-ext-enable imagick
It seems that it was installed:
php -i | grep imagick
Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini,
imagick
imagick module => enabled
imagick module version => 3.4.3
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
imagick.skip_version_check => 0 => 0
But when I type «which convert» e.g nothing returns.
If you want the convert
command (which is not a PHP command nor is it even related to PHP), you need to install a package which provides it. In Debian Stretch, that’s graphicsmagick-imagemagick-compat
or imagemagick-6.q16
(as can be seen on https://packages.debian.org/stretch/imagemagick).
I ran into some problems trying to install Imagick to a CircleCI container. Specifically, a cryptic Exited with code 141
error:
The solution was to ignore the error with || true
.
In total, installation looks like this:
sudo apt-get update sudo apt-get install -y libmagickwand-dev --no-install-recommends yes '' | sudo pecl install imagick || true sudo docker-php-ext-enable imagick
This solution works like a charm for PHP5.
RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && apt-get update && apt-get install -y --no-install-recommends libmagickwand-dev && rm -rf /var/lib/apt/lists/* && pecl install imagick-3.3.0 && docker-php-ext-enable imagick
However, the image build fails when I try to target a specific Imagick beta version (3.2.0RC1, I am trying to reproduce as faithfully as possible our production environment). It would seem like the MagickWand is not compatible (?):
checking ImageMagick MagickWand API configuration program... configure: error: not found. Please provide a path to MagickWand-config or Wand-config program. ERROR: /tmp/pear/temp/imagick/configure --with-php-config=/usr/local/bin/php-config --with-imagick' failed The command '/bin/sh -c export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && apt-get update && apt-get install -y --no-install-recommends libmagickwand-6.q16-dev && rm -rf /var/lib/apt/lists/* && pecl install imagick-3.2.0RC1 && docker-php-ext-enable imagick' returned a non-zero code: 1
#Install imagemagick:
ENV MAGICK_HOME=/usr
RUN apk --no-cache update
&& apk --no-cache upgrade
&& apk add --update freetype-dev libpng-dev libjpeg-turbo-dev libxml2-dev autoconf g++ imagemagick-dev imagemagick libtool make
&& docker-php-ext-configure gd
--with-gd
--with-freetype-dir=/usr/include/
--with-png-dir=/usr/include/
--with-jpeg-dir=/usr/include/
&& docker-php-ext-install gd
&& docker-php-ext-install mbstring
&& docker-php-ext-install mysqli
&& docker-php-ext-install opcache
&& docker-php-ext-install soap
&& pecl install imagick
&& docker-php-ext-enable imagick
&& apk del autoconf g++ libtool make
Best solution php 7.3
Just a side note: I recently added Alpine support to my install-php-extensions
script: you can easily install the imagick
PHP extension (as well as many other extensions) on Alpine & Debian by running:
ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions && sync && install-php-extensions imagick
Putting all together, even avoiding the interactive shell of «autodetect» :
FROM php:7.2-fpm RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && apt-get update -y && apt-get install -y --no-install-recommends libmagickwand-dev && rm -rf /var/lib/apt/lists/* && yes '' | pecl install imagick-3.4.3|| true && docker-php-ext-enable imagick
But still it does not work. May be my case is different : I have supervisord is the main process (PID 1) and there is no php-fpm is runnning… because the role of this container is to be queue worker only (php artisan queue:work ).
I am not sure which should i restart to make it work ?
OR should I hit php-fpm
to start fpm process ? or no need ?
UPDATE :
Also you need to install gs
or ghostscripts
if you are converting from PDF to images.
wget https://github.com/luvvien/resources/raw/master/ghostscript-9.22-linux-x86_64.tar.gz && tar -xzvf ghostscript-9.22-linux-x86_64.tar.gz && cd ghostscript-9.22-linux-x86_64 && cp gs-922-linux-x86_64 /usr/local/bin/gs && ln -s /usr/local/bin/gs /usr/bin/gs && rm ../ghostscript-9.22-linux-x86_64.tar.gz && rm -rf ghostscript-9.22-linux-x86_64
Add mme to this thread,
I am getting:
Starting to download imagick-3.4.3.tgz (245,410 bytes)
...................................................done: 245,410 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Please provide the prefix of Imagemagick installation [autodetect] : building in /tmp/pear/temp/pear-build-defaultuserhpr4zS/imagick-3.4.3
running: /tmp/pear/temp/imagick/configure --with-php-config=/usr/local/bin/php-config --with-imagick
ls: cannot access '.': Operation not permitted
configure: error: working directory cannot be determined
ERROR: `/tmp/pear/temp/imagick/configure --with-php-config=/usr/local/bin/php-config --with-imagick' failed
ERROR: Service 'httpd' failed to build: The command '/bin/sh -c export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && apt-get update && apt-get install -y --no-install-recommends libmagickwand-dev && rm -rf /var/lib/apt/lists/* && pecl install imagick-3.4.3 && docker-php-ext-enable imagick' returned a non-zero code: 1
With the following:
FROM php:7-apache RUN apt-get update; apt-get install -y autoconf g++ make openssl libmcrypt-dev libreadline-dev libssl-dev libcurl4-openssl-dev pkg-config libsasl2-dev zlibc zlib*-dev gi$ docker-php-ext-install gd; docker-php-ext-install mysqli; docker-php-ext-install pdo; docker-php-ext-install pdo_mysql; docker-php-ext-install exif; pecl channel-update pecl.php.net; RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" && apt-get update && apt-get install -y --no-install-recommends libmagickwand-dev && rm -rf /var/lib/apt/lists/* && pecl install imagick-3.4.3 && docker-php-ext-enable imagick
Note, I tried the docker-php-extension-installer
which looks really cool, but getting the same result
UPDATE: Switching from 7
(which right now is version 7.4.x) to 7.2
seems to have resoled the issue. Perhaps is this a PHP 7.4 issue?
@AddoSolutions what about using my install-php-extensions
script? It makes your life much easier, and you can install many PHP extensions with just one line without having to worry about apt packages (and saving disk space because the script removes the apt packages needed just at compile time)…
Here’s how you can install the extensions you need:
FROM php:7-apache COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ RUN install-php-extensions gd mysqli pdo pdo_mysql exif imagick
Here’s the list of supported extensions.
@mlocati I did try that for the issue I described, however it still would not work on the latest php:7-apache
image. After changing to 7.2-apache
it worked fine.
I am guessing this is an issue with the PHP image, but don’t have enough info to prove it, and ran out of time to diagnose
Going forward however, I will be refactoring the docker image to use that extension is is supremely helpful! Thanks for putting that together 👍
@mlocati Nope, this was a local build from a Dockerfile
[me@xxx ~]# hostnamectl
Static hostname: xxx
Icon name: computer-vm
Chassis: vm
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.xxx.el7.x86_64
Architecture: x86-64
[me@xxx ~]# docker -v
Docker version 19.03.2, build 6a30dfc
@AddoSolutions accordingly to this message the reason may be because you are using a rather old linux kernel version
EDIT The root cause is that the coreutils that comes with Debian 11 (Bullseye) is version 8.32, and that version prevent docker images from running when the host OS uses a rather old kernel. The solution is to keep using Debian 10 (Buster), which uses coreutils 8.30 (which is not affected by this problem).
@mlocati I appreciate all the help – I guess it’s going to be a day of kernel updates, woohoo!
@AddoSolutions please keep me updated, I’m really curious to see if that works 😉
-
#1
Today i reinstall my server with CentOS 7
everything running fine.
but when i try to install Imagick from WHM > Software > Module Installer > PHP Pecl
i got this error:
ea-php56
Code:
downloading imagick-3.4.3RC1.tgz ...
Starting to download imagick-3.4.3RC1.tgz (245,140 bytes)
.........................done: 245,140 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
Please provide the prefix of Imagemagick installation [autodetect] : building in /opt/cpanel/ea-php56/root/usr/var/tmp/php-pear/pear-build-rootjKbk2o/imagick-3.4.3RC1
running: /opt/cpanel/ea-php56/root/usr/var/tmp/php-pear/imagick/configure --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config --with-imagick
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/cpanel/ea-php56/root/usr
checking for PHP includes... -I/opt/cpanel/ea-php56/root/usr/include/php -I/opt/cpanel/ea-php56/root/usr/include/php/main -I/opt/cpanel/ea-php56/root/usr/include/php/TSRM -I/opt/cpanel/ea-php56/root/usr/include/php/Zend -I/opt/cpanel/ea-php56/root/usr/include/php/ext -I/opt/cpanel/ea-php56/root/usr/include/php/ext/date/lib
checking for PHP extension directory... /opt/cpanel/ea-php56/root/usr/lib64/php/modules
checking for PHP installed headers prefix... /opt/cpanel/ea-php56/root/usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
ERROR: `/opt/cpanel/ea-php56/root/usr/var/tmp/php-pear/imagick/configure --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config --with-imagick' failed
ea-php7
Code:
downloading imagick-3.4.3RC1.tgz ...
Starting to download imagick-3.4.3RC1.tgz (245,140 bytes)
...................................................done: 245,140 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
Please provide the prefix of Imagemagick installation [autodetect] : building in /opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/pear-build-rootlTF8Mn/imagick-3.4.3RC1
running: /opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/imagick/configure --with-php-config=/opt/cpanel/ea-php70/root/usr/bin/php-config --with-imagick
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/cpanel/ea-php70/root/usr
checking for PHP includes... -I/opt/cpanel/ea-php70/root/usr/include/php -I/opt/cpanel/ea-php70/root/usr/include/php/main -I/opt/cpanel/ea-php70/root/usr/include/php/TSRM -I/opt/cpanel/ea-php70/root/usr/include/php/Zend -I/opt/cpanel/ea-php70/root/usr/include/php/ext -I/opt/cpanel/ea-php70/root/usr/include/php/ext/date/lib
checking for PHP extension directory... /opt/cpanel/ea-php70/root/usr/lib64/php/modules
checking for PHP installed headers prefix... /opt/cpanel/ea-php70/root/usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
ERROR: `/opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/imagick/configure --with-php-config=/opt/cpanel/ea-php70/root/usr/bin/php-config --with-imagick' failed
On my previous install, there is a script to install imagick. but i don’t see it anymore. maybe cPanel remove it.
Does anyone have solution?
Thanks
Last edited: Sep 2, 2016
-
#3
Hi thanks,
I have run command, but it still same error
Code:
/opt/cpanel/ea-php56/root/usr/bin/pecl install imagick
Code:
[[email protected] ~]# /opt/cpanel/ea-php56/root/usr/bin/pecl install imagick
downloading imagick-3.4.3RC1.tgz ...
Starting to download imagick-3.4.3RC1.tgz (245,140 bytes)
.........done: 245,140 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
Please provide the prefix of Imagemagick installation [autodetect] :
building in /opt/cpanel/ea-php56/root/usr/var/tmp/php-pear/pear-build-rootljBdUv/imagick-3.4.3RC1
running: /opt/cpanel/ea-php56/root/usr/var/tmp/php-pear/imagick/configure --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config --with-imagick
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/cpanel/ea-php56/root/usr
checking for PHP includes... -I/opt/cpanel/ea-php56/root/usr/include/php -I/opt/cpanel/ea-php56/root/usr/include/php/main -I/opt/cpanel/ea-php56/root/usr/include/php/TSRM -I/opt/cpanel/ea-php56/root/usr/include/php/Zend -I/opt/cpanel/ea-php56/root/usr/include/php/ext -I/opt/cpanel/ea-php56/root/usr/include/php/ext/date/lib
checking for PHP extension directory... /opt/cpanel/ea-php56/root/usr/lib64/php/modules
checking for PHP installed headers prefix... /opt/cpanel/ea-php56/root/usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
ERROR: `/opt/cpanel/ea-php56/root/usr/var/tmp/php-pear/imagick/configure --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config --with-imagick' failed
-
#4
i am sure, when i still use CentOS 6.8, it can install it perfectly
-
#5
You should re-read that other thread. In your first post above in the output:
running: /opt/cpanel/ea-php70/root/usr/var/tmp/php-pear/imagick/configure
But you ran the command with a different version of php in the command:
/opt/cpanel/ea-php56/root/usr/bin/pecl install imagick
From that other thread I mentioned:
Note that EasyApache 4 includes support for multiple versions of PHP, so you must utilize the PHP 5.6 SCL if that’s the version you want to install it on, as indicated by the above command.
What version of PHP is installed?
-
#6
What version of PHP is installed?
Hi thanks for reply
only PHP 5.6 and PHP 7.0 installed from EA4
and i remove PHP 5.5 from EA4
-
#7
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
Hello,
Check to ensure the ImageMagick and ImageMagick-devel packages are installed on the system before running that PECL installation command:
Code:
yum install ImageMagick ImageMagick-devel
You may also need to install the «pcre-devel» package.
Thank you.
-
#8
Hello,
Check to ensure the ImageMagick and ImageMagick-devel packages are installed on the system before running that PECL installation command:
Code:
yum install ImageMagick ImageMagick-devel
You may also need to install the «pcre-devel» package.
Thank you.
hi thanks, i have run that command, now everything fine. I think if it already at WHM, we don’t need to run that command again
-
#9
I’m happy to see the issue is now resolved. Thank you for updating us with the outcome.
-
#10
There’s a thread on that at:
Installing Imagick CentOS 7
Thanks!
I installed it,
ImageMagick ImageMagick-devel + pcre-devel
Where i must to this enable?
-
#11
Where i must to this enable?
You will need to install those packages via the command line with «YUM». EX:
Code:
yum install ImageMagick ImageMagick-devel pcre-devel
Thank you.
-
#12
You will need to install those packages via the command line with «YUM». EX:
Code:
yum install ImageMagick ImageMagick-devel pcre-devel
Thank you.
(Package pcre-devel-8.32-15.el7_2.1.x86_64 already installed and latest version
Nothing to do)
I installed it.
But i can’t enable the imagick.
Where i find this to enable on WHM.
-
#14
Yep, i did this restarted, it’s same won’t enable.
-
#15
Hello,
Ensure you install the actual PECL module rather than just installing those packages via YUM. This specific post describes the process:
SOLVED — Pecl with EA4
Thank you.
-
#16
Hey!
I’m sorry about re-opening these, but I have a issue pretty much related. I can’t finalize my installation of Imagick (ImageMagick) for PHP (whatever version) on my WHM panel, at a dedicated server.
When I try to install it via «Module Installer => PHP PECL» manager, I got this result:
Last metadata expiration check: 3:44:02 ago on Wed Jun 15 11:07:54 2022.
Package ImageMagick-devel-6.9.12.50-2.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to
update
downloading imagick-3.7.0.tgz ...
Starting to download imagick-3.7.0.tgz (360,138 bytes)
.........................................................................done: 360,138 bytes
33 source files, building
running: phpize
sh: phpize: command not found
ERROR: `phpize' failed
More info: Screenshot
I got stuck in order to make phpize to work, I guess that is the last only issue that I have to solve.
Could you help me, please?
Thanks in advance!
-
#18
Hi @cPRex!
Yes, I already did that, and is showing that is everything installed.
Something else?
Thank you!
-
#19
Alright, that’s good. Can you try this on the command line now? I don’t think the Pecl installation through the module installers will work with the modern versions:
Code:
/opt/cpanel/ea-php74/root/usr/bin/pecl install imagick
Just change that PHP version in the command to the specific version you’re working with.
-
#20
Thanks!
I already tried that and this is what I got:
Let me know what else I can do, and, what is the best way to update what is saying about PECL channel.
Regards!
Sorry if this has been asked/answered before… a cursory search didn’t show any immediately relevant results.
I’m working on installing ImageMagick and Imagick and could use some help. I have XAMPP installed on OS 10.5.8. I managed to get ImageMagick installed using macports. I then created a .bash_profile and added this path to it:
export PATH=$PATH:/Volumes/bootay/Applications/XAMPP/xamppfiles/bin/
After doing that, I tried to install Imagick using:
sudo pecl install imagick
which gave me the error message at the end:
checking ImageMagick MagickWand API configuration program… configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
ERROR: `/Applications/XAMPP/xamppfiles/temp/pear/temp/imagick/configure —with-imagick’ failed
I then downloaded MagickWand and ran phpize on it, which gave me the error message:
checking MagickWand-config in default path… configure: error: Cannot locate configuration program MagickWand-config
At this point, I’m not sure what I should do. Should I have run ./configure prior to running phpize? Or what?
p.s. I went ahead and tried running ./configure for MagickWand. At the end I got error:
checking MagickWand-config in default path… configure: error: Cannot locate configuration program MagickWand-config
I checked for the existence of Wand-config and got:
Computer-157:MagickWandForPHP-1.0.7 mymac$ Wand-config —version
6.6.9 Q16
I then added a path to MagickWand-config:
export PATH=$PATH:/opt/local/var/macports/software/ImageMagick/6.6.9-1_1+q16/opt/local/bin/
and was able to run phpize successfully. However, running ./configure gives error:
checking MagickWand-config in default path… configure: error: Cannot locate configuration program MagickWand-config
which I don’t understand given that I added that path previously.