Deprecated: This guide is now deprecated. You can now install ImageMagick for PHP 5.6,7.0,7.1,7.2,7.3,7.4 from PHP>Install extensions. Follow this instruction http://docs.cyberpanel.net/doku.php?id=php-extensions .
Update on 25th August
ImageMagick is now available in LiteSpeed official repo and can be installed using
yum install lsphpXX-pecl-imagick
Replace XX with PHP version. You can also use the instructions below but they are not needed anymore.
Prerequisites
To install ImageMagick/imagick php extension you need a package called ImageMagic-devel, you can install from yum
yum install ImageMagick-devel -y
You also need php devel package, gcc and make:
yum install lsphp72-devel make gcc
Download imagick
imagick packages are available at https://pecl.php.net/package/imagick
You can download the latest version, current latest version is 3.4.3.
Note: We are installing it for PHP 7.2, process is similar for other php versions.
cd wget https://pecl.php.net/get/imagick-3.4.3.tgz tar zxf imagick-3.4.3.tgz
Installation
cd imagick-3.4.3 /usr/local/lsws/lsphp72/bin/phpize ./configure --with-php-config=/usr/local/lsws/lsphp72/bin/php-config make make install
Then open your php.ini file which is located at /usr/local/lsws/lsphp72/etc/php.ini
and append following at the end:
extension=/usr/local/lsws/lsphp72/lib64/php/modules/imagick.so
Now restart OpenLiteSpeed:
systemctl restart lsws
Comments
---------------------------------------------------------------------
Test Imagick, subImageMatch [tests/151_Imagick_subImageMatch_basic.phpt]
Test PECL bug #20636 [tests/bug20636.phpt]
=====================================================================
@usmannasir can this be added to inbuilt extension install section of cyberpanel in upcoming updates.
yum install lsphpXX-pecl-imagick
Replace XX with PHP version. I will also update main article and add in the CyberPanel list.
@cloudrider
I added to CyberPanel PHP Extension installer and pushed the package (works for new installs, others can use the command above and restart LiteSpeed)
Can you let me know how I can enable the local webp conversion support with the now included imagick extension.
I was trying to enable webp support with LScache plugin but it was not working, then landed on this github link.
https://github.com/rosell-dk/webp-convert/wiki/Installing-Imagick-extension-with-WebP-support
Any idea how I can enable webp images support for WordPress sites.
yum install GraphicsMagick
I'll try that out.
There is currently a libMagickWand.so.5 library error.
Wczytane wtyczki: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: centos.hitme.net.pl
* epel: ftp.icm.edu.pl
* extras: centos1.hti.pl
* updates: centos.hitme.net.pl
Rozwiązywanie zależności
--> Wykonywanie sprawdzania transakcji
---> Pakiet lsphp71-pecl-imagick.x86_64 0:3.4.4-2.el7.7.1 zostanie zainstalowany
--> Przetwarzanie zależności: libMagickWand.so.5()(64bit) dla pakietu: lsphp71-pecl-imagick-3.4.4-2.el7.7.1.x86_64
--> Przetwarzanie zależności: libMagickCore.so.5()(64bit) dla pakietu: lsphp71-pecl-imagick-3.4.4-2.el7.7.1.x86_64
--> Ukończono rozwiązywanie zależności
Błąd: Pakiet: lsphp71-pecl-imagick-3.4.4-2.el7.7.1.x86_64 (litespeed-update-mirror)
Wymaga: libMagickCore.so.5()(64bit)
Błąd: Pakiet: lsphp71-pecl-imagick-3.4.4-2.el7.7.1.x86_64 (litespeed-update-mirror)
Wymaga: libMagickWand.so.5()(64bit)
Można spróbować użyć --skip-broken, aby obejść problem
Można spróbować wykonać polecenie: rpm -Va --nofiles --nodigest
https://your_hostname:8090/managephp/installExtensions