Archive

Archive for April, 2012

ลง Imagemagick และ PHP Imagick extension บน CentOS

April 17, 2012 Leave a comment

ทดสอบแล้วบน Centos 5.5 32 Bit

ก่อนอื่นให้ใช้คำสั่งด้านล่าง ใน ssh (ไล่ไปทีละบรรทัดนะครับ)

yum install ImageMagick.i386
yum install ImageMagick-devel.i386
pecl install imagick

ถ้าเจอ Error ด้านล่างหลังจากใช้คำสั่ง pecl install imagick:

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

ให้ใช้คำสั่งนี้:

mount -o remount,rw /tmp

หลังจากเสร็จขั้นตอนการติดตั้ง ให้สร้างไฟล์สั่งโหลด php extension imagick และ restart httpd ด้วยคำสั่งด้านล่าง

echo "extension=imagick.so" > /etc/php.d/imagick.ini
/etc/init.d/httpd restart

ทดสอบการโหลด modules imagick:

php -m | grep imagick

Categories: Linux Tags: