Page 1 of 1

How to install Imagick on Ubuntu 16.04 LTS with XAMPP

PostPosted: 05. December 2017 20:27
by ubuntuxampp
Hi

here's how I managed to add Imagick to XAMPP on fresh Ubuntu 16.04 LTS

Files I had to download:

I used this version of XAMPP
Code: Select all
https://downloadsapachefriends.global.ssl.fastly.net/xampp-files/7.1.11/xampp-linux-x64-7.1.11-0-installer.run


Choose the version of PHP source code that matches the the version your XAMPP uses. In this case 7.1.11 = 7.1.11
Code: Select all
http://php.net/distributions/php-7.1.11.tar.gz


Imagick
Code: Select all
https://pecl.php.net/get/imagick-3.4.3.tgz


Install these packages:
Code: Select all
sudo apt-get install php-pear
sudo apt-get install autoconf
sudo apt-get install libmagickwand-6.q16-dev


Extract the PHP source code to /opt/lampp/include/php - this folder wasn't on my pc. Probably because I installed XAMPP without 'developers files'. You might also have to change permissions in order to be able to copy something to /opt/lampp (or run
Code: Select all
sudo -i
to become root and then run
Code: Select all
nautilus
to start the file manager with root rights and avoid changing permissions ;-)

Run these commands
Code: Select all
sudo -i
cd /opt/lampp/include/php/
./configure

Extract Imagick anywhere you want to - I used
Code: Select all
/home/user/Downloads/imagick/imagick-3.4.3


Run
Code: Select all
cd /home/user/Downloads/imagick/imagick-3.4.3
sudo /opt/lampp/bin/phpize
./configure --with-php-config=/opt/lampp/bin/php-config
make
make install


Now add this line
Code: Select all
extension="imagick.so"
to /opt/lampp/etc/php.ini. I added it just above ;zend_extension=opcache.so to line 1030

Start or restart XAMPP and you should see imagick in your PHP info

Image

Other source that can help you
https://www.thelinuxfaq.com/171-how-to-configure-imagemagick-with-php-in-xampp

Enjoy :)