Posts Tagged ‘imagick’

Installare imagemagick con l’estensione imagick per PHP su CentOS

Per installare imagemagick con l’estensione imagick per PHP su una CentOS è sufficiente seguire questi passi:
yum install ImageMagick.i386
yum install ImageMagick-devel.i386
pecl install imagick

Nel caso in cui abbiate questo errore:
root@myhost [~]# pecl install imagick
downloading imagick-3.0.1.tgz ...
Starting to download imagick-3.0.1.tgz (93,920 bytes)
.....................done: 93,920 bytes
13 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-root/imagick-3.0.1
running: /root/tmp/pear/imagick/configure --with-imagick
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/imagick/configure --with-imagick' failed

Date un’occhiata alla vostra directory /tmp… quasi sicuramente è montata con il flag noexec. Remount it without noexec e riprovate:
mount -o remount,rw /tmp

Una volta terminata l’installazione, create un file di inclusione per il modulo imagick.so e riavviate apache:
echo "extension=imagick.so" > /etc/php.d/imagick.ini
/etc/init.d/httpd restart

Testate il corretto caricamento del modulo imagick tramite:
php -m | grep imagick