Want to subscribe to topics you're interested in?
Become a Member

PHP-FPM Imagick not enabled

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by sepulchre, May 3, 2019.

  1. sepulchre

    sepulchre Member

    145
    22
    18
    Dec 22, 2014
    Ratings:
    +26
    Local Time:
    6:18 PM
    • CentOS Version: CentOS Linux release 7.4.1708 (Core)
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.15.10
    • PHP Version Installed: 7.3.2
    • MariaDB MySQL Version Installed: 10.1.31-MariaDB
    • When was last time updated Centmin Mod code base ? 5 mins ago
    • Persistent Config:
      Code:
      LETSENCRYPT_DETECT='y'

    Hello,

    not sure what happened here but I see in my XF installation that imagick support is not enabled. Not sure since when this is the case. I should have enabled it from the start.
    Anyway, no problem I thought, I just reinstall it again via centmin menu. I did that, did do nprestart and still no difference.

    What is the problem here?
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    output for these commands
    Code (Text):
    php -v
    

    Code (Text):
    php --ri imagick
    


    Every centmin.sh menu option has a full server log created with time stamped file name at /root/centminlogs. You can check that specific error log for clues or copy and paste log contents and post to pastebin.com or gist.github.com for sharing.

    To troubleshoot, you need to check the the php-imagick-install logs created when you run centmin.sh menu option 15 at /root/centminlogs and upload contents to Pastebin.com or Gists.

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest php-imagick-install to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for php-imagick-install named log
    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'php-imagick-install'
    

    Code (Text):
    ls -lahrt /root/centminlogs | grep imagick
    -rw-r--r--   1 root root  32K Apr 30 14:08 centminmod_123.09beta01.b144_300419-140341_php-imagick-install.log
    -rw-rw-r--   1 root root  32K May  3 13:01 centminmod_123.09beta01.b152_030519-130039_php-imagick-install.log
    

    So the last php-imagick-install log was named centminmod_123.09beta01.b152_030519-130039_php-imagick-install.log and located at /root/centminlogs/centminmod_123.09beta01.b152_030519-130039_php-imagick-install.log

    then use cat command to output the contents of that log.

    clear your ssh window buffer/screen and type
    Code (Text):
    cat centminmod_123.09beta01.b152_030519-130039_php-imagick-install.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share. If your SSH client's scroll buffer isn't large enough using cat might not output the entire log file contents, so you may need to download the log and use local text editor to open and copy and paste.

    so only need content of a specific log, in this case most recent php-imagick-install log
     
    • Like Like x 1
  3. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    as you versions are old, i'd do a yum update and server reboot to move to centos 7.6 too and centmin.sh menu option 4 to update nginx 1.15.12 and centmin.sh menu option 5 to update to php 7.3.5 too
     
    • Like Like x 1
  4. sepulchre

    sepulchre Member

    145
    22
    18
    Dec 22, 2014
    Ratings:
    +26
    Local Time:
    6:18 PM
    Before I do all the other logs, the first two commands probably say what the problem is. (I didn't know that command, so seeing it for the first time).

    Code:
    PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so (/usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20180731/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    PHP 7.3.2 (cli) (built: Apr 11 2019 16:40:29) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.2, Copyright (c) 1999-2018, by Zend Technologies
    Does this help figuring it out or should I proceed with the rest of the protocol?


    And how can I do this?
     
  5. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yes that means imagick php extension isn't loaded, my suggested updates particularly for updating php to 7.3.5 should resolve that
     
    • Like Like x 1
  6. sepulchre

    sepulchre Member

    145
    22
    18
    Dec 22, 2014
    Ratings:
    +26
    Local Time:
    6:18 PM
    I updated PHP to 7.3.5 and restarted php. Still same error. I tried to install imagick via centmin menu again, and still same error.

    What should I do now?


    https://pastebin.com/NnPkFCKm


    Edit: Gonna update CentOS now. Maybe a CentOS bug?

    Edit2: Still same problem.
     
    Last edited: May 4, 2019
  7. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Every centmin.sh menu option has a full server log created with time stamped file name at /root/centminlogs. You can check that specific error log for clues or copy and paste log contents and post to pastebin.com or gist.github.com for sharing.

    To troubleshoot, you need to check the the php upgrade logs at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the nginx_upgrade and php_upgrade logs. You can see full details at How to troubleshoot Centmin Mod initial install issues

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest php_upgrade log to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for nginx_upgrade or php in log name
    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    

    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    -rw-r--r--  1 root root  2.6M Oct  3 03:48 centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    -rw-r--r--  1 root root  664K Oct 12 09:24 centminmod_1.2.3-eva2000.09.001_121016-092406_nginx_upgrade.log
    

    So the last php upgrade log was named centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log and located at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    then use cat command to output the contents of that log.

    clear your ssh window buffer/screen and type
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share. If your SSH client's scroll buffer isn't large enough using cat might not output the entire log file contents, so you may need to download the log and use local text editor to open and copy and paste.

    so only need content of a specific log, in this case most recent php_upgrade.log logs
     
    • Like Like x 1
  8. sepulchre

    sepulchre Member

    145
    22
    18
    Dec 22, 2014
    Ratings:
    +26
    Local Time:
    6:18 PM
  9. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    from php_upgrade log looks like imagemagick yum package is missing (strange it should be installed at initial install time)
    Code (Text):
    checking for pkg-config... /bin/pkg-config
    checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
    checking Testing /usr/bin/MagickWand-config... Doesn't exist
    checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
    checking Testing /opt/bin/MagickWand-config... Doesn't exist
    checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
    configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
    make: *** No targets specified and no makefile found.  Stop.
    make: *** No rule to make target `install'.  Stop.
    

    and your previous log for imagick centmin.sh menu option 15 https://community.centminmod.com/threads/imagick-not-enabled.17417/#post-73495 seems imagemagick yum package isn't getting installed for some reason
    Code (Text):
    [1;33;40mCheck for ImageMagicK System Updates (YUM)
    [mLoaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.checkdomain.de
     * epel: mirror.wiuwiu.de
     * extras: mirror.ratiokontakt.de
     * remi: mirror.23media.de
     * updates: mirror.checkdomain.de
    Package(s) ImageMagick6-devel available, but not installed.
    Package(s) ImageMagick6-c++-devel available, but not installed.
    No packages marked for update
    

    what output do you get for SSH command below
    Code (Text):
    yum -q list ImageMagick6 ImageMagick6-devel ImageMagick6-c++ ImageMagick6-c++-devel ImageMagick6-libs | tr -s ' ' | column -t

    example
    Code (Text):
    yum -q list ImageMagick6 ImageMagick6-devel ImageMagick6-c++ ImageMagick6-c++-devel ImageMagick6-libs | tr -s ' ' | column -t   
    Installed                      Packages
    ImageMagick6.x86_64            6.9.10.43-1.el7.remi  @remi
    ImageMagick6-c++.x86_64        6.9.10.43-1.el7.remi  @remi
    ImageMagick6-c++-devel.x86_64  6.9.10.43-1.el7.remi  @remi
    ImageMagick6-devel.x86_64      6.9.10.43-1.el7.remi  @remi
    ImageMagick6-libs.x86_64       6.9.10.43-1.el7.remi  @remi
    

    if it doesn't show all 5 packages as being installed, then you somehow managed to remove some packages along the way

    you can check the history of a yum package via yum history info command
    Code (Text):
    yum history info ImageMagick6-devel

    post that output to pastebin.com or gist.github.com

    you can reinstall them via these 3 commands
    Code (Text):
    yum versionlock delete ImageMagick6 ImageMagick6-devel ImageMagick6-c++ ImageMagick6-c++-devel ImageMagick6-libs
    yum -y install ImageMagick6 ImageMagick6-devel ImageMagick6-c++ ImageMagick6-c++-devel ImageMagick6-libs --enablerepo=remi
    yum versionlock ImageMagick6 ImageMagick6-devel ImageMagick6-c++ ImageMagick6-c++-devel ImageMagick6-libs
    

    then centmin.sh menu option 15, should reinstall imagick php extension
     
    • Winner Winner x 1
  10. sepulchre

    sepulchre Member

    145
    22
    18
    Dec 22, 2014
    Ratings:
    +26
    Local Time:
    6:18 PM
    Code:
    yum -q list ImageMagick6 ImageMagick6-devel ImageMagick6-c++ ImageMagick6-c++-devel ImageMagick6-libs | tr -s ' ' | column -t
    Installed                 Packages
    ImageMagick6.x86_64       6.9.10.43-1.el7.remi  @remi
    ImageMagick6-c++.x86_64   6.9.10.43-1.el7.remi  @remi
    ImageMagick6-libs.x86_64  6.9.10.43-1.el7.remi  @remi
    I think I know now what the problem is. See:
    https://community.centminmod.com/posts/72769/

    Basically I asked 1 month ago how to free space and it was told that it was safe to delete those temporary files. Probably doing that caused this problem and I didn't realize it back then.

    Here the history log:

    https://pastebin.com/2XNEM2ZT


    Can confirm, it works now. Thank you!!!

    The question is if those deleting of temporary files caused other problems I am not aware of yet. We'll see I guess.
     
    Last edited: May 4, 2019
  11. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    not related as only yum remove/erase command would of removed yum packages and it confirms this in yum history info log's most recent entry on April 11, 2019
    Code (Text):
    # yum history info ImageMagick6-devel
    Loaded plugins: fastestmirror, priorities, versionlock
    Transaction ID : 48
    Begin time     : Thu Apr 11 16:20:58 2019
    Begin rpmdb    : 702:650899fefeaa768bcc4d7b09acf5fe36aa4ee35d
    End time       :            16:20:59 2019 (1 seconds)
    End rpmdb      : 701:e66bfb7bc233d64afd6612a1bafcabadab49732f
    User           : xxxx <root>
    Return-Code    : Success
    Command Line   : -y swap libwebp-devel libwebp7-devel --enablerepo=remi
    Transaction performed with:
    Loading mirror speeds from cached hostfile
     * base: centosmirror.netcup.net
     * centos-sclo-rh: centosmirror.netcup.net
     * centos-sclo-sclo: centosmirror.netcup.net
     * epel: mirror.wiuwiu.de
     * extras: centosmirror.netcup.net
     * rpmforge: mirror1.hs-esslingen.de
     * updates: mirror.checkdomain.de
    309 packages excluded due to repository priority protections
       Updated       rpm-4.11.3-25.el7.x86_64                      ?
       Installed     yum-3.4.3-161.el7.centos.noarch               @base
       Updated       yum-plugin-fastestmirror-1.1.31-42.el7.noarch ?
       Updated       yum-plugin-versionlock-1.1.31-42.el7.noarch   @base
    Packages Altered:
       Erase       ImageMagick6-c++-devel-6.9.9.40-1.el7.remi.x86_64 @remi
       Erase       ImageMagick6-devel-6.9.9.40-1.el7.remi.x86_64     @remi
       Erase       libwebp-devel-0.3.0-7.el7.x86_64                  @base
       Dep-Install libwebp7-1.0.2-1.el7.remi.x86_64                  @remi
       Install     libwebp7-devel-1.0.2-1.el7.remi.x86_64            @remi
    -------------------------------------------------------------------------------
    

    yum command ran was
    Code (Text):
    Command Line   : -y swap libwebp-devel libwebp7-devel --enablerepo=remi

    part of a centmin mod routine to fix updated/change libwebp7-devel update which inadvertently removed some dependencies
    Code (Text):
    Packages Altered:
       Erase       ImageMagick6-c++-devel-6.9.9.40-1.el7.remi.x86_64 @remi
       Erase       ImageMagick6-devel-6.9.9.40-1.el7.remi.x86_64     @remi
       Erase       libwebp-devel-0.3.0-7.el7.x86_64                  @base
       Dep-Install libwebp7-1.0.2-1.el7.remi.x86_64                  @remi
       Install     libwebp7-devel-1.0.2-1.el7.remi.x86_64            @remi
    

    however, the yum swap command should of been followed by command to reinstall the removed packages but they weren't so will need to look into this

    example from one my server's yum history info see transaction id = 441 reinstalled the removed dependencies from transaction id = 440's yum command
    Code (Text):
    -------------------------------------------------------------------------------
    Transaction ID : 441
    Begin time     : Mon Apr  1 18:34:23 2019
    Begin rpmdb    : 1266:c9d327239c3d9d108db727f8b555278635f05329
    End time       :            18:34:24 2019 (1 seconds)
    End rpmdb      : 1268:d9d703dbe0e0a7a487318adfd9bebc1ede5050b2
    User           : root <root>
    Return-Code    : Success
    Command Line   : -y install ImageMagick6-devel ImageMagick6-c++-devel --enablerepo=remi --disablerepo=rpmforge --disableplugin=priorities,versionlock
    Transaction performed with:
        Installed     rpm-4.11.3-35.el7.x86_64                      @base
        Installed     yum-3.4.3-161.el7.centos.noarch               @base
        Installed     yum-metadata-parser-1.1.4-10.el7.x86_64       @anaconda
        Installed     yum-plugin-fastestmirror-1.1.31-50.el7.noarch @base
    Packages Altered:
        Updated ImageMagick6-6.9.10.30-1.el7.remi.x86_64           @remi
        Update               6.9.10.34-1.el7.remi.x86_64           @remi
        Updated ImageMagick6-c++-6.9.10.30-1.el7.remi.x86_64       @remi
        Update                   6.9.10.34-1.el7.remi.x86_64       @remi
        Install ImageMagick6-c++-devel-6.9.10.34-1.el7.remi.x86_64 @remi
        Install ImageMagick6-devel-6.9.10.34-1.el7.remi.x86_64     @remi
        Updated ImageMagick6-libs-6.9.10.30-1.el7.remi.x86_64      @remi
        Update                    6.9.10.34-1.el7.remi.x86_64      @remi
    -------------------------------------------------------------------------------
    Transaction ID : 440
    Begin time     : Mon Apr  1 18:34:15 2019
    Begin rpmdb    : 1268:669aa0b82d607ff6c1d693432cbcd606c994303d
    End time       :                          (0 seconds)
    End rpmdb      : 1266:c9d327239c3d9d108db727f8b555278635f05329
    User           : root <root>
    Return-Code    : Success
    Command Line   : -y swap libwebp-devel libwebp7-devel --enablerepo=remi
    Transaction performed with:
        Installed     rpm-4.11.3-35.el7.x86_64                      @base
        Installed     yum-3.4.3-161.el7.centos.noarch               @base
        Installed     yum-metadata-parser-1.1.4-10.el7.x86_64       @anaconda
        Installed     yum-plugin-fastestmirror-1.1.31-50.el7.noarch @base
        Installed     yum-plugin-versionlock-1.1.31-50.el7.noarch   @base
    Packages Altered:
        Erase   ImageMagick6-c++-devel-6.9.10.30-1.el7.remi.x86_64 @remi
        Erase   ImageMagick6-devel-6.9.10.30-1.el7.remi.x86_64     @remi
        Erase   libwebp-devel-0.3.0-7.el7.x86_64                   @base
        Install libwebp7-devel-1.0.2-1.el7.remi.x86_64             @remi
    -------------------------------------------------------------------------------
    
     
    • Like Like x 1
  12. sepulchre

    sepulchre Member

    145
    22
    18
    Dec 22, 2014
    Ratings:
    +26
    Local Time:
    6:18 PM
    I understand but I find it highly strange. I don't remember typing a command which is related to yum packages. And I checked my last typed commands in ssh going months back, I can't find any entry of typing that command ever. I am not sure how the history shows this command whereas I never typed or entered that command.
    Very strange. I don't know how to use the yum commands honestly, so I wouldn't type that ever intentionally. Only accidentally or if you tell me to do it. It will remain a mystery to me. Now is all good, thanks for your help and if you need anymore logs to fix the stuff, you are welcome.

    btw. I deleted those files (mentioned earlier, those one to free space) by using FileZilla. So I didn't use the -rf command because I was afraid of mistyping and deleting files accidentally. FileZilla is much safer because I can see what I am deleting. Maybe FileZilla did it? I don't know, just giving you the whole picture so you have all the info.
     
  13. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    no that yum swap command was triggered by centmin.sh menu routine to fix a bug ~2 months ago but part of that routine is to reinstall the erased yum packages but yours didn't reinstall them
     
    • Like Like x 1
  14. sepulchre

    sepulchre Member

    145
    22
    18
    Dec 22, 2014
    Ratings:
    +26
    Local Time:
    6:18 PM
    Ahhh, right. I see. Okay, for a second I was afraid someone got access to my server or something :D. But that explains it of course.
    Maybe I didn't have the latest centmin version and you had a bug in your system back then. Unlucky coincidence maybe?
     
  15. eva2000

    eva2000 Administrator Staff Member

    41,645
    9,380
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,408
    Local Time:
    2:18 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    • Like Like x 1