Hướng dẫn cách cài đặt Imagemagick trên Centos 7
Trước khi làm, bạn nên cập nhật hệ thống.
shell> yum update
shell> yum groupinstall "Development Tools"
shell> yum install ImageMagick ImageMagick-devel -y
Tải về Imagemagic
Với bản CentOS 6.8 dùng Directadmin, gõ các lệnh sau để tải, giản nén, và cài đặt
shell> wget http://pecl.php.net/get/imagick-3.4.3RC1.tgz
shell> tar -zxf imagick-3.4.3RC1.tgz
shell> cd imagick-3.4.3RC1
shell> /usr/local/php56/bin/phpize
shell> ./configure with-php-config=/usr/local/php56/bin/php-config
shell> make
shell> make install
Với bản Centos 7, dùng link tải sau
shell> wget http://pecl.php.net/get/imagick-3.4.3RC1.tgz
shell> tar -zxf imagick-3.4.3RC1.tgz
shell> cd imagick-3.4.3RC1
shell> ./configure
shell> make
shell> make install
Sau khi cài đặt, bạn cần cấu hình dòng extension=imagick.so xuống phía dưới cùng của file php.ini f
Find the loaded php.ini file.
Với bản PHP 5.5 or 5.6, file php.ini tìm tại:
shell> php -i | grep php.ini
Loaded Configuration File => /etc/php.ini
Với PHP 7, file php tìm tại:
shell> php70 -i | grep php.ini
Configuration File (php.ini) Path => /etc/opt/remi/php70
Loaded Configuration File => /etc/opt/remi/php70/php.ini
Restart lại php-fpm trong CentOS 6.8.
shell> service php-fpm56 restart
Với PHP 7.0 trên CentOS 7:
shell> systemctl restart php70-php-fpm.service
Quá trình cài đặt đã hoàn tất!
Kiểm tra phiên bản cài đặt
we can verify the installation of ImageMagick using the following commands.
php -i | grep Imagick
Chúc các bạn thành công !