0

I'm trying since one week but it's not working. I've installed imagemagick on Ubuntu 16.04 LTS. I executed following command in terminal and got this:

convert -version

Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-02 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

That means it is installed? But in phpinfo() it doesn't show the imagick module. I added the extension in right php.ini file but still same result. Is this the issue with Ubuntu?

Further, I tried commands listed here but none of them worked. I got following error:

E: Package 'php5' has no installation candidate

E: Package 'php5-common' has no installation candidate

PS: I want this to work because I'm using Intervention library for image editing and that is not working since imagick is not listed in phpinfo().

Vikas
  • 720
  • 1
  • 9
  • 30
  • 1
    http://askubuntu.com/questions/769396/how-to-install-imagemagick-for-php7-on-ubuntu-16-04 – ewcz Mar 14 '17 at 10:04
  • downvoter any valid reason for downvote? – Vikas Mar 14 '17 at 10:11
  • @ewcz yes I have already installed using that but still `phpinfo()` doesn't show the imagick module – Vikas Mar 14 '17 at 10:17
  • @ewcz you may want to read this: http://stackoverflow.com/questions/42779255/intervention-imagick-works-in-terminal-but-not-in-browser/42779915#42779915 – Vikas Mar 14 '17 at 10:33

1 Answers1

3

you are using ubuntu 16.04 which is often use php7.0.8 .

in the same time that you are trying to install imagick for a different version of php

to install imagick follow this steps:

sudo apt-get install php7.0-common

sudo apt-get install php-imagick

after that make sure that you have enabled the extension and restarted your apache :

sudo phpenmod imagick

sudo service apache2 restart
hassan
  • 7,812
  • 2
  • 25
  • 36
  • I just executed above commands and still there's no extension listed in `phpinfo()` – Vikas Mar 14 '17 at 10:16
  • what's your php version ? and what's that command's output `php -m | grep imagick` – hassan Mar 14 '17 at 10:18
  • with php -m it shows only "imagick". with php -i it shows this => imagick imagick module => enabled imagick module version => 3.4.3 imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel imagick.locale_fix => 0 => 0 imagick.progress_monitor => 0 => 0 imagick.skip_version_check => 0 => 0 – Vikas Mar 14 '17 at 10:32
  • Here's the elaboration of my problem: http://stackoverflow.com/questions/42779255/intervention-imagick-works-in-terminal-but-not-in-browser/42779915#42779915 – Vikas Mar 14 '17 at 10:34
  • `sudo phpenmod imagick;sudo service apache2 restart` this sould be enough , from my local machine `imagick module enabled` after following the previous steps – hassan Mar 14 '17 at 10:38
  • Which OS? The imagick module is not listed and I'm still getting same error: 'ImageMagick module not available with this PHP installation. – Vikas Mar 14 '17 at 10:58
  • Is there any specific place where I should add this in php.ini? I just put it randomly. – Vikas Mar 14 '17 at 11:00
  • you don't need to add this `extension=imagick.so` manually at all! sudo phpenmod imagick enough , try to remove this lines from php.ini's and enable imagick again from the phpenmod command and check – hassan Mar 14 '17 at 11:03
  • Okay. I'm checking – Vikas Mar 14 '17 at 11:05
  • It's still there :/ – Vikas Mar 14 '17 at 11:14