Issue with Imagick and Php 7.4
Hello Admins,
Greetings!
I have recently installed Php 7.4 and trying to configure it inorder upgrade my site from Php 7.2 to 7.4.
Everything is fine except Imagick.
Php 7.2 has it installed and running but it is giving error when I try to install it using module installer > Php PECL.
I selected the Php 7.4 version and while trying to install Imagick but I am getting following error :
===========================================================================================
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 91.197.228.252
* EA4-experimental: 91.197.228.252
* cpanel-addons-production-feed: 91.197.228.252
* cpanel-plugins: 91.197.228.252
* base: uk.mirrors.clouvider.net
* epel: mirrors.ukfast.co.uk
* extras: mirror.as29550.net
* updates: mirror.as29550.net
Package ImageMagick-devel-6.9.10.68-3.el7.x86_64 already installed and latest version
Nothing to do
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to
update
downloading imagick-3.4.4.tgz ...
Starting to download imagick-3.4.4.tgz (253,434 bytes)
.....................................................done: 253,434 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 /root/tmp/pear/pear
-build-rootBOWick/imagick-3.4.4
running: /root/tmp/pear/imagick/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-co
nfig --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 pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /opt/cpanel/ea-php74/root/usr
checking for PHP includes... -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root
/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/u
sr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/
include/php/ext/date/lib
checking for PHP extension directory... /opt/cpanel/ea-php74/root/usr/lib64/php/modules
checking for PHP installed headers prefix... /opt/cpanel/ea-php74/root/usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
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/MagickW
and-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... It exists
found in /usr/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 6.9.10 Q16
checking for MagickWand.h or magick-wand.h header... user location /usr/include/ImageMagick-6/wand/M
agickWand.h
checking PHP version is at least 5.3.2... yes. found 7.4.12
libs
-lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI
checking for MagickGetVersion... yes
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert
_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/sh /root/tmp/pear/pear-build-rootBOWick/imagick-3.4.4/libtool --mode=compile cc -fopenmp -DMAGI
CKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-7 -I. -I/root/tmp/pe
ar/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootBOWick/imagick-3.4.4/include -I/root/tmp/p
ear/pear-build-rootBOWick/imagick-3.4.4/main -I/root/tmp/pear/imagick -I/opt/cpanel/ea-php74/root/us
r/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/inclu
de/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include
/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib -I/usr/include/ImageMagick-7 -DHA
VE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagick_file.c -o imagick_file.lo
libtool: compile: cc -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/inclu
de/ImageMagick-7 -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootBOWick/
imagick-3.4.4/include -I/root/tmp/pear/pear-build-rootBOWick/imagick-3.4.4/main -I/root/tmp/pear/ima
gick -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I
/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/o
pt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib
-I/usr/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagick_file.c -fPIC
-DPIC -o .libs/imagick_file.o
In file included from /root/tmp/pear/imagick/php_imagick_file.h:24:0,
from /root/tmp/pear/imagick/imagick_file.c:22:
/root/tmp/pear/imagick/php_imagick_defs.h:29:31: fatal error: wand/MagickWand.h: No such file or dir
ectory
# include
^
compilation terminated.
make: *** [imagick_file.lo] Error 1
ERROR: `make' failed
====================================================================
May be I am missing something here...
Any help or pointers would be highly appreciated. M
Regards,
Joseph.
-
Hi All, An I figured it out my self. Yayyyyy!! I found that somehow there were two ImageMagick's directories on my server. Not sure how! I found two separate directories : /usr/include/ImageMagick-7 /usr/include/ImageMagick-6 Anyways, I wanted to try re-install ImageMagick and I found the install version using : rpm -qa |grep ImageMagick which gave me following result: ImageMagick-6.9.10.68-3.el7.x86_64 ImageMagick-devel-6.9.10.68-3.el7.x86_64 I remove it using : yum remove ImageMagick-6.9.10.68-3.el7.x86_64 it removed the dependencies as well. Then I installed it again using Yum: yum install ImageMagick ImageMagick-devel ImageMagick-perl php-devel gcc It should installed ImageMagick again. After that tried enabling the php image magick extension on php 7.4 again (manually and using cPanel) but unfortunately It failed again. Investigating it further I found that in the make command it was referencing the path /usr/include/ImageMagick-7 I guess it was used as well. I though why not installed the latest version of Imagick, so I followed the installation below : # wget ImageMagick Copyright: " 1999-2019 ImageMagick Studio LLC License: ImageMagick Features: Cipher DPC HDRI OpenMP Delegates (built-in): bzlib fontconfig freetype jng jpeg lzma png tiff x xml zlib and I guess it installed ImageMagick-7 again. After this installing the php extension from cpanel (module installer > install pecl) worked charm. Finally got it working!!!!!!!!! Not sure how I came from reinstalling 6 and installing 7. That made no sense to me after giving it a thought but I guess I was frustrated spending long hours trying to fix it, so wanted to try everything. Hope it helps others. Regards, Joseph. 0 -
I'm glad you were able to track this down and get it working! 0
Please sign in to leave a comment.
Comments
2 comments