Reado

Well-Known Member
Sep 8, 2009
256
16
68
United Kingdom
cPanel Access Level
Root Administrator
PECL via the command line appears to be broken too. Online sources suggest it has something to do with PHP being installed via YUM. Running "pecl install imagick" for example results in:

Warning: Invalid argument supplied for foreach() in /usr/local/lib/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/local/lib/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/local/lib/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/local/lib/php/PEAR/Command.php on line 249
XML Extension not found
root@l1vs09rcms [~]#

After reverting to EA3, the problem with PECL goes away.

PECL installer works fine in WHM, just not the command line. I need to install via the command line as I need a beta PECL module as the beta version supports PHP 7 whereas the stable version does not.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello,

I've moved this post into it's own thread.

It's important to use the full path to the PECL binary associated with your version of PHP. I successfully installed the Imagick PECL module for PHP 7 via the command line with EasyApache 4:

Code:
/opt/cpanel/ea-php70/root/usr/bin/pecl install imagick
Please ensure you also review the following documents that explain how to edit your php.ini file with EasyApache 4, as you must do this manually after installing the PECL module:

How to edit your php.ini file
cPanel's PHPRC PHP Patch for EasyApache 4

Could you let us know if this helps?

Note: Keep in mind some PECL module will fail to install if required libraries are missing. For instance, I installed ImageMagick via "/scripts/installimagemagick" before proceeding with the "imagick" PECL installation.

Thank you.
 
  • Like
Reactions: eva2000

Reado

Well-Known Member
Sep 8, 2009
256
16
68
United Kingdom
cPanel Access Level
Root Administrator
Thanks - I'll try that the next time I try EA4. I had to downgrade to EA3 as I found EA4 too buggy for my liking and it's missing features compared to EA3 that we currently depend on. Bit disappointing.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
why not have cpanel also setup pecl command as an alias to full path out of the box ?
Hello,

EasyApache 4 includes support for multiple PHP versions. Using the full path ensures you are installing the PECL module for the appropriate version (e.g. some PECL modules may not work with all versions of PHP).

Thank you.
 
  • Like
Reactions: eva2000

FCTW

Member
Feb 16, 2015
8
0
1
cPanel Access Level
Root Administrator
[snip]
It's important to use the full path to the PECL binary associated with your version of PHP. I successfully installed the Imagick PECL module for PHP 7 via the command line with EasyApache 4:

Code:
/opt/cpanel/ea-php70/root/usr/bin/pecl install imagick
[snip]
That's true, but I get the following message when running the suggested command:
Code:
root@hostname [~]# /opt/cpanel/ea-php70/root/usr/bin/pecl install imagick
downloading imagick-3.4.3RC1.tgz ...
Starting to download imagick-3.4.3RC1.tgz (245,140 bytes)
..............................................done: 245,140 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
I was able to resolve this by removing ea-php70 with EasyApache 4 from WHM, and then re-installing it, but if cPanelMichael or anyone else knows how I could have resolved that without 'coping out' with an uninstall/reinstall I would really love to know.

Just as a footnote, the server I was working on didn't have /scripts/installimagemagick, and so it doesn't seem to be a strict requirement to loading the PHP module.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello @FCTW,

It looks like the output from the command wasn't fully pasted. Could you paste the full output from your initial installation attempt?

Thank you.
 

FCTW

Member
Feb 16, 2015
8
0
1
cPanel Access Level
Root Administrator
Hello @FCTW,

It looks like the output from the command wasn't fully pasted. Could you paste the full output from your initial installation attempt?

Thank you.
Thanks for your quick reply! I have the output but it's rather lengthy. Do you want me to paste it here, or do you have a pastebin you'd rather have that in?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello,

You can paste it here. Just post the lines that show the failure message.

Thanks!
 

FCTW

Member
Feb 16, 2015
8
0
1
cPanel Access Level
Root Administrator
Okay,
Install command output was:
Code:
root@hostname [~]# /opt/cpanel/ea-php70/root/usr/bin/pecl install imagick
downloading imagick-3.4.3RC1.tgz ...
Starting to download imagick-3.4.3RC1.tgz (245,140 bytes)
..............................................done: 245,140 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
Please provide the prefix of Imagemagick installation [autodetect] :
building in /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1
running: /root/tmp/pear/imagick/configure --with-php-config=/usr/local/bin/php-config --with-imagick
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /usr/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... It exists
found in /usr/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 6.7.2 Q16
checking for MagickWand.h or magick-wand.h header... /usr/include/ImageMagick/wand/MagickWand.h
checking PHP version is at least 5.1.3... yes. found 5.5.33
libs
-lMagickWand -lMagickCore


checking for MagickGetVersion... yes
checking for MagickSetImageInterpolateMethod... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1966080
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagick_file.c -o imagick_file.lo
mkdir .libs
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagick_file.c  -fPIC -DPIC -o .libs/imagick_file.o
/root/tmp/pear/imagick/imagick_file.c: In function ‘php_imagick_is_url’:
/root/tmp/pear/imagick/imagick_file.c:85: warning: passing argument 2 of ‘php_stream_locate_url_wrapper’ from incompatible pointer type
/usr/local/include/php/main/php_streams.h:552: note: expected ‘char **’ but argument is of type ‘const char **’
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagick_class.c -o imagick_class.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagick_class.c  -fPIC -DPIC -o .libs/imagick_class.o
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_getimagematte’:
/root/tmp/pear/imagick/imagick_class.c:299: warning: ‘MagickGetImageMatte’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:82)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_paintfloodfillimage’:
/root/tmp/pear/imagick/imagick_class.c:1248: warning: ‘MagickPaintFloodfillImage’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:99)
/root/tmp/pear/imagick/imagick_class.c:1256: warning: ‘MagickPaintFloodfillImage’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:99)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_recolorimage’:
/root/tmp/pear/imagick/imagick_class.c:1738: warning: ‘MagickRecolorImage’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:109)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_colorfloodfillimage’:
/root/tmp/pear/imagick/imagick_class.c:4279: warning: ‘MagickColorFloodfillImage’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:75)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_mapimage’:
/root/tmp/pear/imagick/imagick_class.c:4707: warning: ‘MagickMapImage’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:86)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_mattefloodfillimage’:
/root/tmp/pear/imagick/imagick_class.c:4748: warning: ‘MagickMatteFloodfillImage’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:88)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_medianfilterimage’:
/root/tmp/pear/imagick/imagick_class.c:4786: warning: ‘MagickMedianFilterImage’ is deprecated (declared at /usr/include/ImageMagick/wand/magick-image.h:212)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_paintopaqueimage’:
/root/tmp/pear/imagick/imagick_class.c:4868: warning: ‘MagickPaintOpaqueImageChannel’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:104)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_painttransparentimage’:
/root/tmp/pear/imagick/imagick_class.c:4951: warning: ‘MagickPaintTransparentImage’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:107)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_reducenoiseimage’:
/root/tmp/pear/imagick/imagick_class.c:5115: warning: ‘MagickReduceNoiseImage’ is deprecated (declared at /usr/include/ImageMagick/wand/magick-image.h:260)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_getimageattribute’:
/root/tmp/pear/imagick/imagick_class.c:6444: warning: ‘MagickGetImageAttribute’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:59)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_getimagechannelextrema’:
/root/tmp/pear/imagick/imagick_class.c:6661: warning: ‘MagickGetImageChannelExtrema’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:78)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_getimageextrema’:
/root/tmp/pear/imagick/imagick_class.c:7003: warning: ‘MagickGetImageExtrema’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:80)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_getimageindex’:
/root/tmp/pear/imagick/imagick_class.c:8115: warning: ‘MagickGetImageIndex’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:65)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_getimagesize’:
/root/tmp/pear/imagick/imagick_class.c:8236: warning: ‘MagickGetImageSize’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:140)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_setimageattribute’:
/root/tmp/pear/imagick/imagick_class.c:8710: warning: ‘MagickSetImageAttribute’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:111)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_flattenimages’:
/root/tmp/pear/imagick/imagick_class.c:9085: warning: ‘MagickFlattenImages’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:132)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_averageimages’:
/root/tmp/pear/imagick/imagick_class.c:10272: warning: ‘MagickAverageImages’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:131)
/root/tmp/pear/imagick/imagick_class.c: In function ‘zim_imagick_mosaicimages’:
/root/tmp/pear/imagick/imagick_class.c:10775: warning: ‘MagickMosaicImages’ is deprecated (declared at /usr/include/ImageMagick/wand/deprecate.h:135)
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagickdraw_class.c -o imagickdraw_class.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagickdraw_class.c  -fPIC -DPIC -o .libs/imagickdraw_class.o
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagickpixel_class.c -o imagickpixel_class.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagickpixel_class.c  -fPIC -DPIC -o .libs/imagickpixel_class.o
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagickpixeliterator_class.c -o imagickpixeliterator_class.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagickpixeliterator_class.c  -fPIC -DPIC -o .libs/imagickpixeliterator_class.o
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagick_helpers.c -o imagick_helpers.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagick_helpers.c  -fPIC -DPIC -o .libs/imagick_helpers.o
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagick.c -o imagick.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagick.c  -fPIC -DPIC -o .libs/imagick.o
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/imagickkernel_class.c -o imagickkernel_class.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/imagickkernel_class.c  -fPIC -DPIC -o .libs/imagickkernel_class.o
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=compile cc -fopenmp -I/usr/include/ImageMagick   -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/imagick/shim_im6_to_im7.c -o shim_im6_to_im7.lo
cc -fopenmp -I/usr/include/ImageMagick -I. -I/root/tmp/pear/imagick -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/imagick/shim_im6_to_im7.c  -fPIC -DPIC -o .libs/shim_im6_to_im7.o
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=link cc -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/include -I/root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/main -I/root/tmp/pear/imagick -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick  -DHAVE_CONFIG_H  -g -O2   -o imagick.la -export-dynamic -avoid-version -prefer-pic -module -rpath /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/modules  imagick_file.lo imagick_class.lo imagickdraw_class.lo imagickpixel_class.lo imagickpixeliterator_class.lo imagick_helpers.lo imagick.lo imagickkernel_class.lo shim_im6_to_im7.lo -lMagickWand -lMagickCore
cc -shared  .libs/imagick_file.o .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick.o .libs/imagickkernel_class.o .libs/shim_im6_to_im7.o  -Wl,--rpath -Wl,/usr/lib64 -Wl,--rpath -Wl,/usr/lib64 /usr/lib64/libMagickWand.so -L/usr/lib64 /usr/lib64/libMagickCore.so  -Wl,-soname -Wl,imagick.so -o .libs/imagick.so
creating imagick.la
(cd .libs && rm -f imagick.la && ln -s ../imagick.la imagick.la)
/bin/sh /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/libtool --mode=install cp ./imagick.la /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/modules
cp ./.libs/imagick.so /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/modules/imagick.so
cp ./.libs/imagick.lai /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/modules/imagick.la
PATH="$PATH:/sbin" ldconfig -n /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /root/tmp/pear/pear-build-rootWyc4A5/imagick-3.4.3RC1/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1" install
Installing shared extensions:     /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/lib/php/extensions/no-debug-non-zts-20121212/
Installing header files:          /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/include/php/
running: find "/root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1" | xargs ls -dils
932167    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1
932205    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr
932206    4 drwxr-xr-x 4 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local
932211    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/include
932212    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/include/php
932213    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/include/php/ext
932214    4 drwxr-xr-x 2 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/include/php/ext/imagick
932215    4 -rw-r--r-- 1 root root    1828 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/include/php/ext/imagick/php_imagick_shared.h
932207    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/lib
932208    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/lib/php
932209    4 drwxr-xr-x 3 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/lib/php/extensions
932210    4 drwxr-xr-x 2 root root    4096 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/lib/php/extensions/no-debug-non-zts-20121212
932204 1088 -rwxr-xr-x 1 root root 1111411 Dec  7 11:56 /root/tmp/pear/pear-build-rootWyc4A5/install-imagick-3.4.3RC1/usr/local/lib/php/extensions/no-debug-non-zts-20121212/imagick.so

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-20121212/imagick.so'
install ok: channel://pecl.php.net/imagick-3.4.3RC1
Extension imagick enabled in php.ini
PHP errors were:
Code:
[07-Dec-2016 16:56:29 UTC] PHP Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20151012
These options need to match
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello,

The output shows the PECL module installed successfully. Regarding this error message:

[07-Dec-2016 16:56:29 UTC] PHP Warning: PHP Startup: imagick: Unable to initialize module Module compiled with module API=20121212 PHP compiled with module API=20151012 These options need to match
Could you upload a PHPINFO file to this account to verify which php.ini file is utilized? It's possible the account is using a custom php.ini file that's looking for a different Imagick path.

Thank you.
 

FCTW

Member
Feb 16, 2015
8
0
1
cPanel Access Level
Root Administrator
It doesn't seem as though it was a problem with the Imagick path, but rather the path that pecl was using for
/opt/cpanel/ea-php70/root/usr/bin/pecl installs. For some reason that command was using the /usr/local/lib/php.ini instead of it's own php.ini at /opt/cpanel/ea-php70/root/etc/php.ini Are you able to shed some light on why, or how ea-php70's pecl was trying to use a separate php.ini file? Where would that change be made?

Edit: I don't have the PHP info page available, as the issue has already been fixed, and this wasn't saved / screen captured.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Are you able to shed some light on why, or how ea-php70's pecl was trying to use a separate php.ini file? Where would that change be made?
Here's the output when running "/opt/cpanel/ea-php70/root/usr/bin/pecl install imagick" in cPanel version 60:

Code:
Build process completed successfully
Installing '/opt/cpanel/ea-php70/root/usr/lib64/php/modules/imagick.so'
Installing '/opt/cpanel/ea-php70/root/usr/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.4.3RC1
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
Thus, you'd then run the following command:

Code:
echo 'extension=imagick.so' > /opt/cpanel/ea-php70/root/etc/php.d/imagick.ini
This is also required when installing PECL modules via WHM, and documented at:

PHP PECL - Documentation - cPanel Documentation

Thank you.
 

Samet Chan

Well-Known Member
Jun 24, 2016
369
42
153
cPanel Access Level
Root Administrator
Twitter
Here's the output when running "/opt/cpanel/ea-php70/root/usr/bin/pecl install imagick" in cPanel version 60:

Code:
Build process completed successfully
Installing '/opt/cpanel/ea-php70/root/usr/lib64/php/modules/imagick.so'
Installing '/opt/cpanel/ea-php70/root/usr/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://pecl.php.net/imagick-3.4.3RC1
configuration option "php_ini" is not set to php.ini location
You should add "extension=imagick.so" to php.ini
Thus, you'd then run the following command:

Code:
echo 'extension=imagick.so' > /opt/cpanel/ea-php70/root/etc/php.d/imagick.ini
This is also required when installing PECL modules via WHM, and documented at:

PHP PECL - Documentation - cPanel Documentation

Thank you.
[root@xxxxxx~]# /opt/cpanel/ea-php70/root/usr/bin/pecl install imagick

Warning: popen() has been disabled for security reasons in OS/Guess.php on line 241

Warning: popen() has been disabled for security reasons in /opt/cpanel/ea-php70/root/usr/share/pear/OS/Guess.php on line 241

Warning: fgets() expects parameter 1 to be resource, null given in OS/Guess.php on line 242

Warning: fgets() expects parameter 1 to be resource, null given in /opt/cpanel/ea-php70/root/usr/share/pear/OS/Guess.php on line 242

Warning: pclose() expects parameter 1 to be resource, null given in OS/Guess.php on line 251

Warning: pclose() expects parameter 1 to be resource, null given in /opt/cpanel/ea-php70/root/usr/share/pear/OS/Guess.php on line 251
downloading imagick-3.4.3RC1.tgz ...
Starting to download imagick-3.4.3RC1.tgz (245,140 bytes)
...................................................done: 245,140 bytes
19 source files, building
running: phpize

Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 465

Warning: popen() has been disabled for security reasons in /opt/cpanel/ea-php70/root/usr/share/pear/PEAR/Builder.php on line 465
ERROR: failed to run `phpize'


It's failed to run problem.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
I guess, i blocked to shell script from added php.ini

disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open
You can temporarily remove "popen" from the disable_functions line in /opt/cpanel/ea-php70/root/etc/php.ini file to allow that command to run.

Thank you.
 
  • Like
Reactions: Samet Chan

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
"Please provide the prefix of Imagemagick installation [autodetect] :"
If you've installed ImageMagick via YUM, simply hit "enter" to have the installer automatically detect the path.

Thank you.
 
  • Like
Reactions: Samet Chan