ImageMagick Installation on Debian 10

Discussion in 'Installation/Configuration' started by Emsanator, Apr 10, 2022.

Tags:
  1. Emsanator

    Emsanator Member

    Hello,
    To install Images I followed the steps on this site and I installed ImageMagick but I couldn't load the PHP module. How can I install the PHP module?

    Code:
    root@serve:~# php --modules | grep imagick
    root@serve:~#
    
    Code:
    root@serve:~# magick --version
    Version: ImageMagick 7.1.0-30 Q16-HDRI x86_64 347b82801:20220327 https://imagemagick.org
    Copyright: (C) 1999 ImageMagick Studio LLC
    License: https://imagemagick.org/script/license.php
    Features: Cipher DPC HDRI OpenMP(4.5)
    Delegates (built-in):
    Compiler: gcc (8.3)
    root@serve:~#
    
    Thank you.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Normally one installs ImageMagick on Debian with ap:

    apt-get install php-imagick

    the benefit is that your setup won't break on updates as it might occur with your manually compiled module.
     
  3. Emsanator

    Emsanator Member

    I took a pre-install snapshot, I just came back with a snapshot and again installed `Imagick`- I still can't see it in `phpinfo`

    Code:
    root@serve:~# identify -version
    Version: ImageMagick 7.1.0-29 Q16-HDRI x86_64 19841 https://imagemagick.org
    Copyright: (C) 1999 ImageMagick Studio LLC
    License: https://imagemagick.org/script/license.php
    Features: Cipher DPC HDRI OpenMP(4.5)
    Delegates (built-in):
    Compiler: gcc (8.3)
    
    
    root@serve:~# apt-get install php-imagick
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    php-imagick is already the newest version (3.6.0-4+0~20220117.35+debian10~1.gbp1    49f82).
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    root@serve:~# php --modules | grep imagick
    root@serve:~#
    
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Put a phpinfo() file in the website, then check if it's shown there. It might be that you e.g. use a different PHP version in that site, or that you have not restarted the PHP fpm daemon of that PHP version or something similar.
     
  5. Emsanator

    Emsanator Member

    I always check with `phpinfo()` but still didn't see Imagick. As you said, I changed the PHP version (PHP 7.4 to 7.0), but it's still not there. I reset the server, but still nothing. I guess I'm skipping somewhere.

    Code:
    root@serve:~# /etc/init.d/php7.0-fpm restart
    [ ok ] Restarting php7.0-fpm (via systemctl): php7.0-fpm.service.
    root@serve:~# /etc/init.d/php8.0-fpm restart
    [ ok ] Restarting php8.0-fpm (via systemctl): php8.0-fpm.service.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Imagick php module is installed and active by default when you follow one of the perfect server guides. E.g. screenshot from Debian 10 perfect server using default PHP in that website in php-fpm mode:
     

    Attached Files:

  7. Emsanator

    Emsanator Member

    I did the installation by following this guide. How can I integrate this module into PHP, Is there a way?
    My phpInfo
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    That's the exact same guide I was using to take this screenshot and the apt command you posted earlier shows that you have imagemagick installed already for the system PHP. But the PHP version you use in that site is not the one from Debian, it's a third-party PHP. So you'll probably have the ImageMagick installed and active in the Debian PHP already, bout you might not have it in that third-party PHP. How did you install that other non-Debian PHP? This PHP version does not get installed when you follow the perfect server guide.
     
  9. Emsanator

    Emsanator Member

    I installed this about 4-5 months ago and didn't do any extra installs. I followed the steps in the manual. (?)
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The Debian 10 perfect server guide does not contain any installation steps for PHP 7.4, the PHP version of Debian 10 is PHP 7.3. According to your phpinfo() output, this site uses PHP 7.4. So either you are not using Debian 10 but Debian 11 or you installed an additional PHP 7.4 version.

    Please run this command and post the result:

    apt-cache search php | grep imagick

    and run the test script from this post and post the result:

    https://www.howtoforge.com/community/threads/please-read-before-posting.58408/
     
  11. Emsanator

    Emsanator Member

    Maybe for PHP 7.4. I don't remember exactly.

    Results:
    Code:
    root@serve:~# lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 10 (buster)
    Release:        10
    Codename:       buster
    
    Code:
    root@serve:~# apt-cache search php | grep imagick
    php-imagick - Provides a wrapper to the ImageMagick library
    php-imagick-all-dev - Provides a wrapper to the ImageMagick library
    php-imagick-dbgsym - debug symbols for php-imagick
    php5.6-imagick - Provides a wrapper to the ImageMagick library
    php5.6-imagick-dbgsym - debug symbols for php5.6-imagick
    php7.0-imagick - Provides a wrapper to the ImageMagick library
    php7.0-imagick-dbgsym - debug symbols for php7.0-imagick
    php7.1-imagick - Provides a wrapper to the ImageMagick library
    php7.1-imagick-dbgsym - debug symbols for php7.1-imagick
    php7.2-imagick - Provides a wrapper to the ImageMagick library
    php7.2-imagick-dbgsym - debug symbols for php7.2-imagick
    php7.3-imagick - Provides a wrapper to the ImageMagick library
    php7.3-imagick-dbgsym - debug symbols for php7.3-imagick
    php7.4-imagick - Provides a wrapper to the ImageMagick library
    php7.4-imagick-dbgsym - debug symbols for php7.4-imagick
    php8.0-imagick - Provides a wrapper to the ImageMagick library
    php8.0-imagick-dbgsym - debug symbols for php8.0-imagick
    php8.1-imagick - Provides a wrapper to the ImageMagick library
    php8.1-imagick-dbgsym - debug symbols for php8.1-imagick
    
    Code:
    root@serve:~# cat htf_report.txt
    
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Debian GNU/Linux 10 (buster)
    
    [INFO] uptime:  19:21:04 up  1:55,  2 users,  load average: 0.11, 0.12, 0.18
    
    [INFO] memory:
                  total        used        free      shared  buff/cache   available
    Mem:          3.8Gi       2.4Gi       269Mi       190Mi       1.1Gi       975Mi
    Swap:            0B          0B          0B
    
    [INFO] systemd failed services status:
    0 loaded units listed. Pass --all to see loaded but inactive units, too.
    To show all installed unit files use 'systemctl list-unit-files'.
    
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.2.8p1
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 7.4.28
    [INFO] php-cgi (used for cgi php in default vhost!) is version 7.3.33
    
    ##### PORT CHECK #####
    
    
    ##### MAIL SERVER CHECK #####
    
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
            Unknown process (nginx:) (PID 5343)
    [INFO] I found the following mail server(s):
            Postfix (PID 1446)
    [INFO] I found the following pop3 server(s):
            Dovecot (PID 963)
    [INFO] I found the following imap server(s):
            Dovecot (PID 963)
    [INFO] I found the following ftp server(s):
            PureFTP (PID 1273)
    
    ##### LISTENING PORTS #####
    (only           ()
    Local           (Address)
    [anywhere]:587          (1446/master)
    [localhost]:6379                (1105/redis-server)
    [localhost]:11211               (902/memcached)
    [anywhere]:110          (963/dovecot)
    [anywhere]:143          (963/dovecot)
    [anywhere]:80           (5343/nginx:)
    [anywhere]:8080         (5343/nginx:)
    [anywhere]:8081         (5343/nginx:)
    [anywhere]:465          (1446/master)
    [anywhere]:21           (1273/pure-ftpd)
    ***.***.***.***:53              (1016/named)
    [localhost]:53          (1016/named)
    [anywhere]:22           (1006/sshd)
    [anywhere]:25           (1446/master)
    [localhost]:953         (1016/named)
    [anywhere]:443          (5343/nginx:)
    [anywhere]:4190         (963/dovecot)
    [anywhere]:993          (963/dovecot)
    [anywhere]:995          (963/dovecot)
    [localhost]:11332               (1045/rspamd:)
    [localhost]:11333               (1045/rspamd:)
    [localhost]:11334               (1045/rspamd:)
    [localhost]:10023               (1166/postgrey)
    *:*:*:*::*:587          (1446/master)
    *:*:*:*::*:6379         (1105/redis-server)
    [localhost]10           (963/dovecot)
    [localhost]43           (963/dovecot)
    *:*:*:*::*:80           (5343/nginx:)
    *:*:*:*::*:8080         (5343/nginx:)
    *:*:*:*::*:8081         (5343/nginx:)
    *:*:*:*::*:35121                (1828/node)
    *:*:*:*::*:465          (1446/master)
    *:*:*:*::*:21           (1273/pure-ftpd)
    *:*:*:*::*:53           (1016/named)
    *:*:*:*::*:22           (1006/sshd)
    *:*:*:*::*:25           (1446/master)
    *:*:*:*::*:953          (1016/named)
    *:*:*:*::*:443          (5343/nginx:)
    *:*:*:*::*:4190         (963/dovecot)
    *:*:*:*::*:993          (963/dovecot)
    *:*:*:*::*:995          (963/dovecot)
    *:*:*:*::*:3306         (1104/mysqld)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy DROP)
    target     prot opt source               destination
    f2b-postfix-sasl  tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 25
    f2b-sshd   tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 22
    ufw-before-logging-input  all  --  [anywhere]/0            [anywhere]/0
    ufw-before-input  all  --  [anywhere]/0            [anywhere]/0
    ufw-after-input  all  --  [anywhere]/0            [anywhere]/0
    ufw-after-logging-input  all  --  [anywhere]/0            [anywhere]/0
    ufw-reject-input  all  --  [anywhere]/0            [anywhere]/0
    ufw-track-input  all  --  [anywhere]/0            [anywhere]/0
    
    Chain FORWARD (policy DROP)
    target     prot opt source               destination
    ufw-before-logging-forward  all  --  [anywhere]/0            [anywhere]/0
    ufw-before-forward  all  --  [anywhere]/0            [anywhere]/0
    ufw-after-forward  all  --  [anywhere]/0            [anywhere]/0
    ufw-after-logging-forward  all  --  [anywhere]/0            [anywhere]/0
    ufw-reject-forward  all  --  [anywhere]/0            [anywhere]/0
    ufw-track-forward  all  --  [anywhere]/0            [anywhere]/0
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    ufw-before-logging-output  all  --  [anywhere]/0            [anywhere]/0
    ufw-before-output  all  --  [anywhere]/0            [anywhere]/0
    ufw-after-output  all  --  [anywhere]/0            [anywhere]/0
    ufw-after-logging-output  all  --  [anywhere]/0            [anywhere]/0
    ufw-reject-output  all  --  [anywhere]/0            [anywhere]/0
    ufw-track-output  all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-before-logging-input (1 references)
    target     prot opt source               destination
    
    Chain ufw-before-logging-output (1 references)
    target     prot opt source               destination
    
    Chain ufw-before-logging-forward (1 references)
    target     prot opt source               destination
    
    Chain ufw-before-input (1 references)
    target     prot opt source               destination
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ufw-logging-deny  all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID
    DROP       all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 3
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 11
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 12
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 8
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            udp spt:67 dpt:68
    ufw-not-local  all  --  [anywhere]/0            [anywhere]/0
    ACCEPT     udp  --  [anywhere]/0            ***.***.***.***          udp dpt:5353
    ACCEPT     udp  --  [anywhere]/0            ***.***.***.***      udp dpt:1900
    ufw-user-input  all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-before-output (1 references)
    target     prot opt source               destination
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ufw-user-output  all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-before-forward (1 references)
    target     prot opt source               destination
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0            ctstate RELATED,ESTABLISHED
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 3
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 11
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 12
    ACCEPT     icmp --  [anywhere]/0            [anywhere]/0            icmptype 8
    ufw-user-forward  all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-after-input (1 references)
    target     prot opt source               destination
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:137
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:138
    ufw-skip-to-policy-input  tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:139
    ufw-skip-to-policy-input  tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:445
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:67
    ufw-skip-to-policy-input  udp  --  [anywhere]/0            [anywhere]/0            udp dpt:68
    ufw-skip-to-policy-input  all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type BROADCAST
    
    Chain ufw-after-output (1 references)
    target     prot opt source               destination
    
    Chain ufw-after-forward (1 references)
    target     prot opt source               destination
    
    Chain ufw-after-logging-input (1 references)
    target     prot opt source               destination
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-after-logging-output (1 references)
    target     prot opt source               destination
    
    Chain ufw-after-logging-forward (1 references)
    target     prot opt source               destination
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-reject-input (1 references)
    target     prot opt source               destination
    
    Chain ufw-reject-output (1 references)
    target     prot opt source               destination
    
    Chain ufw-reject-forward (1 references)
    target     prot opt source               destination
    
    Chain ufw-track-input (1 references)
    target     prot opt source               destination
    
    Chain ufw-track-output (1 references)
    target     prot opt source               destination
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            ctstate NEW
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            ctstate NEW
    
    Chain ufw-track-forward (1 references)
    target     prot opt source               destination
    
    Chain ufw-logging-deny (2 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ctstate INVALID limit: avg 3/min burst 10
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
    
    Chain ufw-logging-allow (0 references)
    target     prot opt source               destination
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW ALLOW] "
    
    Chain ufw-skip-to-policy-input (7 references)
    target     prot opt source               destination
    DROP       all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-skip-to-policy-output (0 references)
    target     prot opt source               destination
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-skip-to-policy-forward (0 references)
    target     prot opt source               destination
    DROP       all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-not-local (1 references)
    target     prot opt source               destination
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type LOCAL
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type MULTICAST
    RETURN     all  --  [anywhere]/0            [anywhere]/0            ADDRTYPE match dst-type BROADCAST
    ufw-logging-deny  all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 10
    DROP       all  --  [anywhere]/0            [anywhere]/0
    
    Chain ufw-user-input (1 references)
    target     prot opt source               destination
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:21
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:22
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:25
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:53
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:80
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:110
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:143
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:443
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:465
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:587
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:993
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:995
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:3306
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:4190
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:8080
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            tcp dpt:8081
    ACCEPT     tcp  --  [anywhere]/0            [anywhere]/0            multiport dports 40110:40210
    ACCEPT     udp  --  [anywhere]/0            [anywhere]/0            udp dpt:53
    
    Chain ufw-user-output (1 references)
    target     prot opt source               destination
    
    Chain ufw-user-forward (1 references)
    target     prot opt source               destination
    
    Chain ufw-user-logging-input (0 references)
    target     prot opt source               destination
    
    Chain ufw-user-logging-output (0 references)
    target     prot opt source               destination
    
    Chain ufw-user-logging-forward (0 references)
    target     prot opt source               destination
    
    Chain ufw-user-limit (0 references)
    target     prot opt source               destination
    LOG        all  --  [anywhere]/0            [anywhere]/0            limit: avg 3/min burst 5 LOG flags 0 level 4 prefix "[UFW LIMIT BLOCK] "
    REJECT     all  --  [anywhere]/0            [anywhere]/0            reject-with icmp-port-unreachable
    
    Chain ufw-user-limit-accept (0 references)
    target     prot opt source               destination
    ACCEPT     all  --  [anywhere]/0            [anywhere]/0
    
    Chain f2b-sshd (1 references)
    target     prot opt source               destination
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***          [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***         [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***       [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    Chain f2b-postfix-sasl (1 references)
    target     prot opt source               destination
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    REJECT     all  --  ***.***.***.***        [anywhere]/0            reject-with icmp-port-unreachable
    RETURN     all  --  [anywhere]/0            [anywhere]/0
    
    
    
    
    ##### LET'S ENCRYPT #####
    acme.sh is installed in /root/.acme.sh/acme.sh
    
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Run:

    apt-get install php7.4-imagick

    to install ImageMagick for this additional PHP version. And take care to undo changes that you made using the tutorial from that other website as a manually compiled PHP module may cause you trouble with updates in future.
     
  13. Emsanator

    Emsanator Member

    Okay, thank you for the information and solution. I wish you a productive week.
     

Share This Page