How can I install ImageMagick in Fedora 26 / Lampp?

797 views Asked by At

I am using Fedora 26 with Lampp(Xampp) version (PhP)5.6.31 and I 'm trying to install ImageMagick through a terminal command like this:

sudo /opt/lampp/bin/pecl install imagick 

I am getting this result:

Downloading imagick-3.4.3.tgz ...
Starting to download imagick-3.4.3.tgz (245,410 bytes)
...................................................done: 245,410 bytes
19 source files, building
running: phpize
grep: /opt/lampp/include/php/main/php.h: No such file or directory
grep: /opt/lampp/include/php/Zend/zend_modules.h: No such file or directory
grep: /opt/lampp/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Please provide the prefix of Imagemagick installation [autodetect] :
building in /tmp/pear/temp/pear-build-margaritisyJF8eL/imagick-3.4.3
running: /tmp/pear/temp/imagick/configure --with-php-config=/opt/lampp/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/lampp
checking for PHP includes... -I/opt/lampp/include/php -I/opt/lampp/include/php/main -I/opt/lampp/include/php/TSRM -I/opt/lampp/include/php/Zend -I/opt/lampp/include/php/ext -I/opt/lampp/include/php/ext/date/lib
 checking for PHP extension directory... /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /opt/lampp/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: `/tmp/pear/temp/imagick/configure --with-php-config=/opt/lampp/bin/php-config --with-imagick' failed

As those are my first steps in Linux world, could anyone help me by giving me step-by-step instructions on how I can make ImageMagick extension work under my lampp ??

Thanks in advance for your help

1

There are 1 answers

0
mattdm On BEST ANSWER

Looks like you are building your own PHP rather than using the system one, but want to use the system PHP. Like so many other answers here, the problem is that you need to have the corresponding devel packages installed. In your case, that's ImageMagick-devel. You can look for lines like:

checking Testing /usr/bin/MagickWand-config... Doesn't exist

and then run sudo dnf install /usr/bin/MagickWand-config to pull in the needed packages. (And it looks from the earlier warning before the error that you also want sudo dnf install re2c.)