X
X
xskif2015-05-06 21:01:03
PHP
xskif, 2015-05-06 21:01:03

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

Tried to chroot and mount temporary directories (/tmp , /var/tmp) as advised here . Does not exceed. Moreover, mount | grep /tmp initially produces an empty response. That is, you cannot remount to rw , install imagick, and then back. Tried to mount manually with setting only rw , didn't help. Changed permissions to 777 for both /tmp directories, didn't help either. I don't know what to do next. You need to install imagick as GD does not work with BMP formats.
UPD: I changed the temporary directory for PEAR via pear config-set temp_dir /root/tmp and the installation went there, but fails with the same error.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xskif, 2015-05-10
@xskif

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!

S
Sergey, 2015-05-09
@Weidmann

yum groupinstall "Development Tools"
Show more output of df, dmesg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question