The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Install imagick in PHP 5.5. and 5.6 with EasyApache 4

Discussion in 'EasyApache' started by did-vmonroig, Feb 9, 2016.

Tags:
  1. did-vmonroig

    did-vmonroig Active Member

    Joined:
    Feb 6, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    We've switched to EasyApache 4 in order to have PHP 5.5 and 5.6 available for our clients.

    Some of them need imagick library, working at least in PHP 5.5. I can't find a rpm available for this module, PECL is now broken and manual installation fails because phpize has no headers for the new PHP homes.

    How should I proceed?

    Thanks in advance.
     
  2. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    510
    Likes Received:
    66
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    In the PECL binary, you can simply remove the '-n' from the binary itself:
    Code:
    root@i-0000cbca [~]# diff /usr/local/bin/pecl pecl
    28c28
    < exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_ar
    gv="On" $INCDIR/peclcmd.php "$@"
    ---
    > exec $PHP -C -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv=
    "On" $INCDIR/peclcmd.php "$@"
    This will allow you to use the PECL binary from the command line. You should be able to install those modules after making this change :D

    Let me know how it goes. Thanks!
     
  3. did-vmonroig

    did-vmonroig Active Member

    Joined:
    Feb 6, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks for your help. With your change PECL seems to work:

    Code:
    # pecl install imagick
    
    .
    .
    .
    
    Build process completed successfully
    Installing '/usr/local/include/php/ext/imagick/php_imagick_shared.h'
    Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/imagick.so'
    install ok: channel://pecl.php.net/imagick-3.3.0
    Extension imagick enabled in php.ini
    
    But this server uses EasyApache 4, so extension hasn't been enabled for webs, as it uses another PHP.INI. I've copied library from /usr/local/lib/php/extensions/no-debug-non-zts-20090626/imagick.so to /opt/cpanel/ea-php55/root/usr/lib64/php/modules/ and created /opt/cpanel/ea-php55/root/etc/php.d/imagick.ini, with this content:

    Code:
    ; Enable imagick extension module
    extension=imagick.so
    
    After an httpd restart, this is the new problem:

    Code:
    PHP Warning:  PHP Startup: imagick: Unable to initialize module
    Module compiled with module API=20090626
    PHP    compiled with module API=20121212
    These options need to match
     in Unknown on line 0
    
     
  4. did-vmonroig

    did-vmonroig Active Member

    Joined:
    Feb 6, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Just for the record, I couln't manage to recompile properly imagick.

    Reverted back to EasyApache 3 and I'll be far from it while it's work in progress. Our clients will have to wait for multihome PHP.
     
  5. MastricX

    MastricX Member

    Joined:
    Aug 29, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Removed the -n in /usr/local/bin/pecl

    pecl config-set bin_dir /opt/cpanel/ea-php56/root/usr/bin/
    pecl config-set php_bin /opt/cpanel/ea-php56/root/usr/bin/php
    pecl config-set php_ini /opt/cpanel/ea-php56/root/etc/php.ini

    pecl install imagick

    Helped me build the correct API version.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see that solution worked well. Thank you for updating this thread with the outcome.
     
Loading...

Share This Page