well, just after upgrading my Ubuntu and therefore moving to php7, I seem not to be able to install imagick extension for php using the same old command
sudo apt-get install php5-imagick
I get this error [tried php7-imagick too]
Package php5-imagick is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php5-imagick' has no installation candidate
what should I do?
asked May 8, 2016 at 16:54
azerafatiazerafati
1,1691 gold badge10 silver badges23 bronze badges
2
Just do:
sudo apt-get install php-imagick
This should install imagick
for
PHP 7.0.
answered May 8, 2016 at 18:20
VideonauthVideonauth
32.4k16 gold badges102 silver badges119 bronze badges
7
Turns out I had to restart the fpm:
sudo service php7.0-fpm reload
Things I tried:
apt install php-imagick
didn't work for me. The module was getting loaded for the PHP CLI [I checked with php -m | grep -i imagick
but through my nginx webserver it didn't show up in the list of modules reported by phpinfo[]
at all.
I even inserted extension=imagick.so
to /etc/php/7.0/fpm/php.ini
manually, just to make sure.
I then tried
purging the php-imagick
package and installing from cpan:
sudo apt install libmagickwand-dev imagemagick php-dev
sudo pecl install imagick
And still, no cigar. It would work through the cli but not via nginx.
answered Oct 6, 2016 at 14:36
alexgalexg
7667 silver badges16 bronze badges
3
For php 5.6: sudo apt-get install php5.6-imagick
For php 7.0:sudo apt-get install php7.0-imagick
For php 7.1: sudo apt-get install php7.1-imagick
For php
7.2: sudo apt-get install php7.2-imagick
For php 7.3: sudo apt-get install php7.3-imagick
For php 7.4: sudo apt-get install php7.4-imagick
For php 8.0: sudo apt-get install php8.0-imagick
For php 8.1: sudo apt-get install php8.1-imagick
After restart apache:sudo service apache2 reload
answered Mar 22, 2021 at 10:57
KokilKokil
2712 silver badges5 bronze badges
5
Installed these packages:
sudo apt install libmagickwand-dev imagemagick php-dev
sudo pecl install imagick
Now replace:
sudo service php7.0-fpm reload
With:
sudo service apache2 restart
Works Great
Zanna♦
67.3k54 gold badges206 silver badges318 bronze badges
answered Dec 6, 2016 at 20:06
2
Now it is 2018, just wanted to highlight, in many cases, you would also want to install php-gd along with php-imagick [if you are installing this for wordpress for example].
sudo apt install php-imagick php-gd
sudo systemctl restart apache2
The use of php-imagick implies php7.2-imagick if 7.2 is what your php version is.
answered Nov 24, 2018 at 21:09
ThavaThava
1393 bronze badges
2