Instal ImageMagick on cpanel server - php

1 - I´m loged to server via SSH;
2 - I runned command yum install ImageMagick ImageMagick-devel pcre-devel;
3 - I runned command /usr/bin/convert --version;
output:
Version: ImageMagick 6.9.10-68 Q16 x86_64 2021-10-14 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(3.1)
Delegates (built-in): bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms ltdl lzma openexr pangocairo png ps rsvg tiff wmf x xml zlib
4 - my php version is 7.3.3;
5 - I runned command /opt/cpanel/ea-php73/root/usr/bin/pecl install imagick;
output:
(***)
Build process completed successfully
Installing '/opt/cpanel/ea-php73/root/usr/include/php/ext/imagick/php_imagick_sh ared.h'
Installing '/opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so'
install ok: channel://pecl.php.net/imagick-3.7.0
Extension imagick enabled in php.ini
6 - no imagick in phpinfo();
WHM version: 102.0.10;
What i missing?

I think the best way to install any module in Cpanel is by using Module Installers
check this
https://support.cpanel.net/hc/en-us/articles/360037048673-How-to-Install-ImageMagick-for-EA-PHP-and-ALT-PHP
also to make sure did you restart your web server after the installation?

Related

Error 'convert: command not found' when using exec(convert ) in PHP script

I have installed my development server on my mac
Catalina 10.15.4
Apache (homebrew) => 2.4.43
PHP (homebrew) => 7.2.29
MySQL => 5.7.28
Imagemagick (homebrew) => 7.0.10
Imagick (homebrew) => 3.4.4
All Works perfectly! Except when i use imagemagick on a php script:
exec('convert -version', $debug, $return);
I get the error:
sh: convert: command not found
But when I do it on the mac Terminal, convert -version, it works! I get:
Version: ImageMagick 7.0.10-0 Q16 x86_64 2020-04-04 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib freetype gslib heic jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp xml zlib
I’ve read the following post and wasn’t able to fix it
https://stackoverflow.com/questions/28627473/error-for-convert-command-in-command-line
I did the following on the mac Terminal : which convert and I get :
/usr/local/bin/convert
My path looks like this:
PATH=/usr/local/opt/php#7.2/sbin:/usr/local/opt/php#7.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
When I open my phpinfo, I see the imagick, but not imagemagick, like so
At this point, I’m not sure what is the problem. Any ideas what it could be?
Use /usr/bin/magick instead.
convert is deprecated in v7+ if I am not mistaken.

Imagick unable to open module file

I'm trying to use Imagick with PHP. I have installed the program, replaced the core dll files, loaded the dll extension with xampp, but now I get this error:
unable to open module file
`C:\Users\sudom\AppData\Local\ImageMagick\IM_MOD_RL_png_.dll': No such
file or directory # warning/module.c/GetMagickModulePath/830
This is the line causing the problem: $image->setImageFormat('png');.
I took a look to the AppData/Local folder, but there's no ImageMagick folder. If I place it there manually, it throws another error.
I use:
ImageMagick-7.0.7-11-Q16-x86-dll
php_imagick-3.4.3-7.1-ts-vc14-x86
Downlod the latest version from here
https://www.imagemagick.org/script/download.php
ImageMagick-7.0.7-12-Q16-x64-dll.exe
or
ImageMagick-7.0.7-12-Q16-x86-dll.exe
install, make sure adding the Imagick folder to the system PATH.
Optionally you can tick legacy utilities (convert, mogrify) during installation. and check in cmd 'magick -version'
c:\convert --version Version: ImageMagick 7.0.7-12 Q16 x64 2017-11-29
http://www.imagemagick.org Copyright: Copyright (C) 1999-2015
ImageMagick Studio LLC License:
http://www.imagemagick.org/script/license.php Visual C++: 180040629
Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib cairo
flif freetype gslib jng jp2 jpeg lcms lqr openexr pangocairo png ps
raw rsvg tiff webp xml zlib
Download php_imagick.dll from https://pecl.php.net/package/imagick/3.4.3/windows
meets your php version requirments, put in to ext folder of php and add it to php.ini file.
extension=php_imagick.dll
Than, go to http://windows.php.net/downloads/pecl/deps/
find needed version
3/27/2016 5:32 PM 32707238 ImageMagick-6.9.3-7-vc11-x64.zip
3/27/2016 5:33 PM 31517070 ImageMagick-6.9.3-7-vc11-x86.zip
3/27/2016 5:34 PM 38717224 ImageMagick-6.9.3-7-vc14-x64.zip
3/27/2016 5:34 PM 37376244 ImageMagick-6.9.3-7-vc14-x86.zip
download package and put all the DLLs files from ImageMagick-6.9.3-7-vc1x-xxx.zip\bin\ except ImageMagickObject.dll to ...\apache\bin\ and restart the apache service.
MUST WORK!
P.S. You can also find all the stuff from mentioned above resources for PHP 7.2 except pecl library. Need to wait for a while.

ImageMagick No decode delegate for this image format

I work under windows and wamp server.
this is my PHP code with Imagick
$imagick = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/' . $this->_name);
where $_SERVER['DOCUMENT_ROOT'].'/'.$this->_name displays :
D:/Sources/my_project/public/media/2/9/1/05201502/55450e1b6543a05201502_9.PNG
I checked that image and it does exist in the folder.
But Imagick throws an exception :
Uncaught exception 'ImagickException' with message 'no decode delegate
for this image format
`D:/Sources/my_project/public/media/2/9/1/05201502/55450b10d8ea705201502_9.PNG'
# error/constitute.c/ReadImage/555' in
D:\Sources\my_project\library\project\Image.php on line 225
I looked for a solution, but didn't find any, how can I fix this?? thank you
Update: This is the result when I type convert -version in the command line :
Version: ImageMagick 6.8.8-4 Q16 x86 2014-01-29 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo freetype jbig jng jp2 jpeg lcms lqr pangocairo \
png ps rsv g tiff webp xml zlib
update
This is the phpinfo of imagick.
ImageMagick number of supported formats: 0
ImageMagick supported formats: no value
Seems that your ImageMagick PHP module does not support any image formats.
Try to find other ImageMagick installation or install PHP from the scratch.
Also - seems that there is already question/answer in SO about that
You should run
convert -version
and report the output. On my system it is
Version: ImageMagick 6.9.0-0 Q16 x86_64 2014-12-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc jbig \
jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps \
rsvg tiff webp wmf x xml zlib
Does your output include png as one of the built-in 'delegates'?
If not, update your installation, or build from current sources.
Finally I found solution for my windows openserver/nginx/php-fpm installation:
Download latest php_imagick distributive for your version of PHP from http://windows.php.net/downloads/pecl/releases/imagick/ (e.g. php_imagick-3.4.3-7.1-ts-vc14-x64.zip)
Extract only php_imagick.dll from this archive to your "php/ext" folder.
Run phpinfo() and check value at line "Imagick compiled with ImageMagick version" (mine was: "ImageMagick 6.9.3-7 Q16 x64 ...").
Now go to http://windows.php.net/downloads/pecl/deps/ and download correct version of Imagick-*.zip file (mine was: ImageMagick-6.9.3-7-vc14-x64.zip).
Extact this archive and copy all *.dll files from "/bin" folder to yout "php/ext" folder (about 145 files).
Restart server and check phpinfo(). ImageMagick now supports about 230+ formats.
Sometimes phpinfo() displays that imagick supports all formats, but php scripts are not respond - in this case double check that you download correct version of Imagick-*.zip for your installations. (ts/nts, VC11/VC14, x64/x86)

Integrate ImageMagick & MagickWand with php ubuntu 12.04

I have installed both ImageMagick and MagickWand in my ubuntu system by refering to the detailed instructions provided in Install ImageMagick From Source and MagickWand For PHP. When I chack whether ImageMagick is installed or not by command identify -version, it shows me follwing message
Version: ImageMagick 6.8.7-9 Q16 i686 2013-12-09 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib djvu fontconfig freetype jng jp2 jpeg lcms lqr openexr pangocairo png tiff x xml zlib
That means Image Magick is installed. And When I check the version of MagickWand with MagickWand-config --version it also shows me the version number 6.8.7 Q16.
But problem is when I try to intialize the wrapper class of the MagickWand i.e. $magick_wand=NewMagickWand(); It shows me the Fatal Error as follows,
Fatal error: Call to undefined function NewMagickWand()
Can somebody tell me where did I make a mistake and how to make it work with php.
$img = new Imagick();
More info here: http://php.net/manual/en/book.imagick.php
This seems to have been the fix: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=22911

installed imagick not seen by php_info

I am not very experienced on linux, and need help here.
I have installed ImageMagick, and you can see the version below:
[root#zpanel temp]# convert -version
Version: ImageMagick 6.8.5-4 2013-05-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms png ps tiff x xml zlib
But I cannot see it in my php_info(check url : http://www.galepress.com/phpinfo.php). I have restarted httpd etc, but no good.
ps : I have also run the following command and get the warnings:
[root#zpanel temp]# php -m | grep imagick
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/src/imagick-3.0.1/modules/imagick.so' - libMagickWand.so.2: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/imagick.so' - /usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
How to install php5-imagick package on Debian:
apt-get install php5-imagick
In case of dependencies problem you may need to try installing the older version:
apt-get install php5-imagick/oldstable
If everything goes well, don't forget to restart the Apache service:
/etc/init.d/apache2 restart
You need to install ImageMagick for php environment.
So, for now you have installed ImageMagick only in Linux

Categories