Join the community today
Become a Member

[Solved] imagick & gmagick: is it a Bug or is it me?

Discussion in 'Bug Reports' started by EckyBrazzz, May 10, 2019.

  1. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    2:58 AM
    1.17.x
    10.3.x
    Code (Text):
    MARCH_TARGETNATIVE='n'
    #------Nginx Dynamic Module Switches
    NGINX_DYNAMICTLS='y'
    NGXDYNAMIC_GEOIPTWOLITE='y'
    NGXDYNAMIC_BROTLI='y'
    NGINX_HPACK='y'
    NGINX_LIBBROTLI='y'
    NGINX_MODSECURITY='y'           # https://community.centminmod.com/threads/update-prep-for-modsecurity-v3-0.12453/
    NGINX_MODSECURITY_MAXMIND='y'   # https://community.centminmod.com/threads/update-inc-mod_security-inc-fix-for-geoip2-conflict-in-123-09beta01.17370/
    NGINX_ZLIBCUSTOM='y'            # Use custom zlib instead of system version
    NGINX_ZLIBVER='1.2.11'          # http://www.zlib.net/ Latest 1.2.11 ZLIB, January 15, 2017
    
    AUTOTUNE_CLIENTMAXBODY='y'      # auto tune client_max_body_size option in nginx.conf
    
    NGINX_GEOIPTWOLITE='y'
    
    #------nginx pagespeed
    NGINX_PAGESPEED='n'
    NGINX_PAGESPEEDGITMASTER='n'
    NGXDYNAMIC_NGXPAGESPEED='n'
    
    #------mariadb
    #------php
    PHP_PGO='y'
    STRIPPHP='y'                    # set 'y' to strip PHP binary to reduce size
    PHP_INSTALL='y'                 # Install PHP /w Fast Process Manager
    PHP_MEMCACHE='y'                # memcache PHP extension
    PHP_PATCH='y'                   # Apply PHP patches if they exist
    PHP_TUNING='y'                  # initial php-fpm install auto tuning
    PHP_BROTLI='y'                  # brotli php extension https://github.com/kjdev/php-ext-brotli
    PHP_LZFOUR='y'                  # lz4 php extension https://github.com/kjdev/php-ext-lz4
    PHP_LZF='y'                     # lzf php extension https://github.com/php/pecl-file_formats-lzf php-ext-lzf
    PHP_ZSTD='y'                    # zstd php extension https://github.com/kjdev/php-ext-zstd
    PHP_CUSTOMSSL='y'               # compile php-fpm against openssl 1.0.2+ or libressl 2.3+ whichever nginx uses
    PHPFINFO='y'                    # Disable or Enable PHP File Info extension
    PHPPCNTL='y'                    # Disable or Enable PHP Process Control extension
    PHPINTL='y'                     # Disable or Enable PHP intl extension
    PHPRECODE=n                     # Disable or Enable PHP Recode extension
    PHPIMAGICK='y'                  # Disable or Enable PHP ImagicK extension
    PHPMAKETEST='y'                 # set to y to enable make test after PHP make for diagnostic purposes
    AUTODETECPHP_OVERRIDE='y'    # when enabled, php updates will always reinstall all php extensions even if minor php version
    PHPIONCUBE='y'                  #
    MEMCACHED_INSTALL='y'           # Install Memcached
    PHPREDIS='n'                    # redis PHP extension install
    AUTODETECPHP_OVERRIDE='n'       # skip recompiles for minor versions set to'y' when compile to majoir version updates
    
    #------Open SSL
    DISABLE_TLSONEZERO_PROTOCOL='y' # disable TLS 1.0 protocol by default industry is moving to deprecate for security
    NOSOURCEOPENSSL='n'             # set to 'y' to disable OpenSSL source compile for system default YUM package setup
    OPENSSL_TLSONETHREE='y'         # whether OpenSSL 1.1.1 builds enable TLSv1.3
    
    LETSENCRYPT_DETECT='y'
    
    WP_AUTOPTIMIZE_GZIP='y'         # https://community.centminmod.com/threads/15314/
    
    #-----GCC Compilers
    GCCINTEL_PHP='y'                # enable PHP-FPM GCC compiler with Intel cpu optimizations
    DEVTOOLSET_PHP='y'              # use devtoolset GCC for GCCINTEL_PHP='y'
    


    When installing gmagick imagick disapears, but my mind tells me that these could work together due to a wp plugin that needs them both.

    WebEpress.png
    WebEpress1.png

    When recomiling PHP getting a strange message:
    Code (Text):
    --------------------------------------------------------
    Enter option [ 1 - 24 ] 5
    --------------------------------------------------------
    
    Do you want to run YUM install checks ?  [y/n]
    
    This will increase your upgrade duration time wise.
    Check the change log centminmod.com/changelog.html
    to see if any Nginx or PHP related new additions
    which require checking YUM prequisites are met.
    If no new additions made, you can skip the
    YUM install check to speed up upgrade time.
    
     [y/n]: n
         ____   _   _  ____       _   _                                _     
        |  _ \ | | | ||  _ \  _  | | | | _ __    __ _  _ __  __ _   __| |  ___
        | |_) || |_| || |_) |(_) | | | || '_ \  / _` || '__|/ _` | / _` | / _ \
        |  __/ |  _  ||  __/  _  | |_| || |_) || (_| || |  | (_| || (_| ||  __/
        |_|    |_| |_||_|    (_)  \___/ | .__/  \__, ||_|   \__,_| \__,_| \___|
                                        |_|     |___/                       
    PHP Upgrade/Downgrade - Would you like to continue? [y/n] y
    
    ----------------------------------------------------------------
    Install which version of PHP? (version i.e. 5.6.40, 7.0.33, NGDEBUG)
    PHP 7.x/7.1.x/7.2.x/7.3.x is GA Stable but still may have broken PHP extensions.
    NGDEBUG is PHP 7.4.0 dev builds minus incompatible PHP extensions
    ----------------------------------------------------------------
    
    Current PHP Version: Warning:
    
    Enter PHP Version number you want to upgrade/downgrade to: 7.3.5
    
    Do you still want to continue? [y/n] y
    ----------------------------------------------------------------
    PHP Warning:  Cannot load module 'imagick' because conflicting module 'gmagick' is already loaded in Unknown on line 0
    PHP Warning:  Cannot load module 'imagick' because conflicting module 'gmagick' is already loaded in Unknown on line 0
    ----------------------------------------------------------------
    Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20180731/
    /svr-setup/geoip /tmp/GraphicsMagick-1.3.31
    Check for php extensions
    


    In Ubuntu it does not seem to be a problem
    Code (Text):
    sudo apt install php-gmagick php-imagick
    
     
    Last edited: May 10, 2019
  2. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    2:58 AM
    1.17.x
    10.3.x
    Guess it's me, tried it on another hoster and gave a conflict error. So Cases Solved
     
  3. eva2000

    eva2000 Administrator Staff Member

    41,380
    9,289
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,253
    Local Time:
    3:58 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Start with outlining exact steps and commands you used to install gmagick
     
  4. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    2:58 AM
    1.17.x
    10.3.x
    Is it possible to use them together them :? Just closed all tabs and refers on how it got it working.
     
  5. eva2000

    eva2000 Administrator Staff Member

    41,380
    9,289
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,253
    Local Time:
    3:58 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    ctrl+H in browser to bring up history window to search for the articles that you referenced ;)
     
  6. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    2:58 AM
    1.17.x
    10.3.x
    WebEpress3.png Guess the main part can be found here Installing GraphicsMagick and Gmagick PHP extension on CentOS 5.6 but install a RC1 version.

    Hmm, history, lot of different browsers open.... But got it. I have the habit to make a backup before starting anything new on my server, just in case it goes wrong, so I always have a "clean" server when replacing the backup. Unfortunately this wipes also the history, so I can't see the commands I used.
     
    Last edited: May 11, 2019
  7. eva2000

    eva2000 Administrator Staff Member

    41,380
    9,289
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,253
    Local Time:
    3:58 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    seems they do conflict, FYI, don't add extensions to php.ini itself, use separate .ini file for each of your custom php extensions you manually add as explained at centminmod.com/phpfpm.html#customphpini. Also outlined in Getting Started Guide Step 17

    so ignore pecl install's instructions to load into /usr/local/lib/php.ini, but use custom .ini file i.e. below used /etc/centminmod/php.d/gmagick.ini
    Code (Text):
    Build process completed successfully
    Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20180731/gmagick.so'
    install ok: channel://pecl.php.net/gmagick-2.0.5RC1
    configuration option "php_ini" is not set to php.ini location
    You should add "extension=gmagick.so" to php.ini
    


    but yes gmagick conflicts with imagick so just use imagick that Centmin Mod installs instead and unload the gmagick.so extension from php.ini or custom .ini file

    Code (Text):
    php --ri gmagick
    PHP Warning:  Cannot load module 'imagick' because conflicting module 'gmagick' is already loaded in Unknown on line 0
    
    gmagick
    
    gmagick module => enabled
    gmagick version => 2.0.5RC1
    GraphicsMagick version => GraphicsMagick 1.3.31 2018-11-17 Q16 http://www.GraphicsMagick.org/
    

    Code (Text):
    php --ri imagick
    PHP Warning:  Cannot load module 'imagick' because conflicting module 'gmagick' is already loaded in Unknown on line 0
    Extension 'imagick' not present.
    


    example of gmagick install on Centmin Mod done manually to work around /tmp directory being mounted with noexec - no executive permissions so set custom pecl tmp to /home/phptmp and pecl channel needed an update too.
    Code (Text):
    pecl install gmagick-2.0.5RC1    
    WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
    downloading gmagick-2.0.5RC1.tgz ...
    

    install steps where I load gmagick.so php extension module into it's own config directory gmagick.ini settings file at /etc/centminmod/php.d/gmagick.ini
    Code (Text):
    yum -q list GraphicsMagick GraphicsMagick-devel
    yum  -y install GraphicsMagick GraphicsMagick-devel
    mkdir -p /home/phptmp
    chmod 1777 /home/phptmp
    export TMPDIR=/home/phptmp
    pear config-set temp_dir /home/phptmp
    pecl channel-update pecl.php.net
    pecl install gmagick-2.0.5RC1
    echo "extension=gmagick.so" > /etc/centminmod/php.d/gmagick.ini
    fpmrestart
    php --ri gmagick
    php --ri imagick
    

    listing all custom *.ini php extension files custom installed by centmin mod while trying to load both gmagick.so and imagick.so php extension modules
    Code (Text):
    php --ini
    PHP Warning:  Cannot load module 'imagick' because conflicting module 'gmagick' is already loaded in Unknown on line 0
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
    /etc/centminmod/php.d/brotli.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/fileinfo.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/gmagick.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/lz4.ini,
    /etc/centminmod/php.d/mailparse.ini,
    /etc/centminmod/php.d/mcrypt.ini,
    /etc/centminmod/php.d/redis.ini,
    /etc/centminmod/php.d/zendopcache.ini,
    /etc/centminmod/php.d/zstd.ini,
    /etc/centminmod/php.d/zz-zendopcache.ini
    

    so since gmagick php extension conflicts with imagick php extension, remove gmagic php extension by removing the gmagick.ini settings file and restarting php-fpm service via service php-fpm restart or cmd shortcut = fpmrestart
    Code (Text):
    cd /etc/centminmod/php.d/
    rm -f /etc/centminmod/php.d/gmagick.ini
    fpmrestart
    

    verify imagick php extension is loading
    Code (Text):
    php --ri imagick
    
    imagick
    
    imagick module => enabled
    imagick module version => 3.4.4
    imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
    Imagick compiled with ImageMagick version => ImageMagick 6.9.10-44 Q16 x86_64 2019-05-06 https://imagemagick.org
    Imagick using ImageMagick library version => ImageMagick 6.9.10-44 Q16 x86_64 2019-05-06 https://imagemagick.org
    ImageMagick copyright => © 1999-2019 ImageMagick Studio LLC
    ImageMagick release date => 2019-05-06
    ImageMagick number of supported formats:  => 240
    ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
    
    Directive => Local Value => Master Value
    imagick.locale_fix => 0 => 0
    imagick.skip_version_check => 0 => 0
    imagick.progress_monitor => 0 => 0
    
     
  8. EckyBrazzz

    EckyBrazzz Active Member

    590
    125
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +232
    Local Time:
    2:58 AM
    1.17.x
    10.3.x
    haha, starting with CMM means first reading the complete manual(RTFM)... Will take several weeks to understand it all.

    Just edited the post before you posted, but to keep my system clean without any left over I always use a backup that I made before starting a new experiment.
     
    • Like Like x 1
  9. eva2000

    eva2000 Administrator Staff Member

    41,380
    9,289
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,253
    Local Time:
    3:58 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    that's why official centmin mod install guide recommends Getting Started Guide https://centminmod.com/getstarted.html as next to read - step 17 for Customising php.ini Settings for php.ini load part at least :)