-
-
Notifications
You must be signed in to change notification settings - Fork 102
Installing Imagick extension with WebP support
I succeeded by simply doing the following after installing imagemagick, libwebp and libwebp-dev:
sudo apt install php-imagick
sudo service apache2 restart
In order to get imagick with WebP on Ubuntu 16.04, you (currently) need to:
- Compile libwebp from source
-
Compile imagemagick from source (
./configure --with-webp=yes
) - Compile php-imagick from source, phpize it and add
extension=/path/to/imagick.so
to php.ini
A simple sudo apt-get install php-imagick
unfortunately does not give you webp support.
Again, you must:
Instructions are here. In short, you need to:
sudo apt-get install libjpeg-dev libpng-dev
wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.1.0.tar.gz
tar xvzf libwebp-1.1.0.tar.gz
cd into the dir
./configure
make
sudo make install
See tutorial here, but configure with webp (./configure --with-webp=yes
)
sudo apt-get update
sudo apt build-dep imagemagick
wget https://imagemagick.org/download/ImageMagick.tar.gz
tar xvzf ImageMagick.tar.gz
cd into the dir
./configure --with-webp=yes
sudo make
sudo make install
sudo ldconfig /usr/local/lib
sudo identify -version # to check if installed ok
make check # optional run in-depth check
Check it this way: identify -list format | grep WEBP
- It should print a line
First find out which version of PHP you are using and the location of the relevant php.ini file. Both of these can be obtained with phpinfo();
. Next do the following (but alter to use the info you just collected):
sudo apt-get update
sudo apt-get install imagemagick gcc libmagickwand-dev php-pear php7.2-dev
sudo pecl install imagick
sudo echo "extension=imagick.so" >> /etc/php/7.2/apache2/php.ini
sudo service apache2 restart
Related: https://askubuntu.com/questions/769396/how-to-install-imagemagick-for-php7-on-ubuntu-16-04
https://github.com/mkoppanen/imagick
First find out which version of PHP you are using and the location of the relevant php.ini file. Both of these can be obtained with phpinfo();
. Next do the following (but alter to use the info you just collected):
wget https://pecl.php.net/get/imagick-3.4.3.tgz
tar xvzf imagick-3.4.3.tgz
cd into the dir
sudo /usr/bin/phpize7.2 # note: find you version of phpize with locate phpize
./configure
make
make install
sudo echo "extension=imagick.so" >> /etc/php/7.2/apache2/php.ini
sudo service apache2 restart