Answer the question
In order to leave comments, you need to log in
CentOS php-imagick gives compile error on installation. What to do?
When I try to install imagick via pecl, I get the following.
# pecl install imagick
downloading imagick-3.1.2.tgz ...
Starting to download imagick-3.1.2.tgz (94,657 bytes)
.....................done: 94,657 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-rootTLr9lD/imagick-3.1.2
running: /var/tmp/imagick/configure --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... configure: error: in `/var/tmp/pear-build-rootTLr9lD/imagick-3.1.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
ERROR: `/var/tmp/imagick/configure --with-imagick' failed
Answer the question
In order to leave comments, you need to log in
Solved the problem myself:
1. Use /tmp/pear , there are archives of downloaded extensions.
2. Unpacked imagick.tgz
3. Ran phpize to check then ./configure which gave me the same errors but saved config.log.
4. It was useful to read the log (once again I am convinced of their usefulness) in the log it was written that compilation fails due to the fact that the compiler cannot find stdio.h.
5. Useful in /usr/include - indeed there is no file, but g++ and gcc are installed.
6. We barely googled the answer for CentOS. It is advised to install glibc-headers.
7. yum install glibc-headers
8. pecl install imagick
9. PROFIT!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question