Install imagick in PHP 5.5. and 5.6 with EasyApache 4
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.
-
Hi, In the PECL binary, you can simply remove the '-n' from the binary itself: 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!0 -
Thanks for your help. With your change PECL seems to work: # 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:; Enable imagick extension module extension=imagick.so
After an httpd restart, this is the new problem: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 00 -
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. 0 -
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. 0 -
Helped me build the correct API version.
Hello, I'm happy to see that solution worked well. Thank you for updating this thread with the outcome.0
Please sign in to leave a comment.
Comments
5 comments