exif and imagick installation

evathias

Verified User
Joined
Mar 18, 2019
Messages
13
Hello
I have Custombuild 2 version 2090 and PHP versions 5.6, 7.1, 7.2 and 7.3 installed.

Recently, after upgrading Wordpress to version 5.2, I see the following suggestions in site health tab:
The optional module exif, is not installed or has been disabled.
Warning The optional module imagick, is not installed, or has been disabled.

How can I install/enable EXIF and imagick, for all installed PHP versions, by using custombuild 2 menu?

Thank you and Kind Regards
Elias
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
Wordpress does not need imagemick. You can also use GD for it, which is way easier to install.
For Centos just use "yum install gd" and you're done.

If you really want imagemick I believe it can be installed via pecl, but don't know how to do this for every php version you have. Somebody else may jump in here to help you with that.

As for exif, you can have a look here:
https://forum.directadmin.com/showthread.php?t=56855
you have to do this for every php version used.
 

wattie

Verified User
Joined
May 31, 2008
Messages
997
Location
Bulgaria
Sadly the upcoming Wordpress 5.2 have a "Health monitor" feature, which shows suggestions for better system and... one of the recommendations is to have Image Magick installed.

It is not required for Wordpress to run normally; however I bet many customers of web hosting companies will ask about it.

Regarding EXIF - add "--enable-exif" in the configure script and recompile php.

Regarding image magick - you can install it using pecl.

Code:
cd /usr/local/php73/bin
./pecl install imagick
Then add the extension to the php.ini file.
 
Last edited:

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
one of the recommendations
A recommendation is not a requirement. Does this healthmonitor not work with GD?

I'm just curious of how it works without Image Magick or what's the benefit of installing this compared to GD for this feature. And how does one update this when installed with pecl?
Because this might be interesting too for us.

Regarding EXIF better use the link I posted because you better create a custom configure script otherwise it will be overwritten by the next php update.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
Thank you Alex.
However, the WordPress core media.php file defaults to GD as its image editor of choice.
And then I read this about the new health feature in Wordpress 5.2:
Media Handling: Active editor, ImageMagick version number, string, resource limits, GD version, Ghostscript version.
Where did you read about the recommendation Wattie?
 

Active8

Verified User
Joined
Jul 13, 2013
Messages
232
The way that wattie said it did not work for me, lot of errors because i had disabled some php functions
here is the way i did it with php 7.2 - centos 7:
Code:
Check on http://pecl.php.net/package/imagick for latest Imagick stable version
 
[B]yum install ImageMagick ImageMagick-devel -y[/B]

[B]wget http://pecl.php.net/get/imagick-3.4.4.tgz
tar -zxf imagick-3.4.4.tgz
cd imagick-3.4.4
/usr/local/php72/bin/phpize
./configure --with-php-config=/usr/local/php72/bin/php-config
make
make install[/B]

Now add to your php.ini (in my case /usr/local/php72/lib/php.ini):

[B]extension=imagick.so[/B]

My php is php-fpm so I restart php-fpm process:

[B]service php-fpm72 restart[/B]
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,341
Location
LT, EU
imagick=yes/no is now a CB 2.0 option from rev. 2109 (defaults to "no"). exif is the default for ~3 weeks. Thank you! :)
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,341
Location
LT, EU
Not by default, as it's disabled by default, but yes, it can be built, it's as easy as:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build set imagick yes
./build imagick
 

wattie

Verified User
Joined
May 31, 2008
Messages
997
Location
Bulgaria
Where did you read about the recommendation Wattie?
Sorry for the late reply. If you go to any wordpress site in /wp-admin/site-health.php you will see the recommendation which suggests installing image magick.

I don't like image magick at all :)
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
Thanks Wattie, I already discovered that in the meantime. :)

But it's just a recommendation, it's not really needed for Wordpress as it works great with GD too.
I don't like Imagick either, but since it can be easily installed via Custombuild, I use it too. If it hadn't be available via Custombuild, good chance I'd not implemented it at all. :)
 

Arieh

Verified User
Joined
May 27, 2008
Messages
1,200
Location
The Netherlands
Just installed Imagick through CB. What I noticed it that it doesn't add extension="imagick.so" to the php.ini(s). Without it, it won't work (maybe that was the thing missing for those above who could not get it to work).
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
Does it need to be in there? I installed imagick on 2 servers via custombuild and it's working, but not present in php.ini as extension either.
Also showing up in phpinfo.php files. That's on Centos 7.

Are you experiencing your issue on Centos too?
 

Arieh

Verified User
Joined
May 27, 2008
Messages
1,200
Location
The Netherlands
I think the extension needs to be in the php.ini. Did you check the right php.ini (as there are many usually).

In custombuild I do see

perl -pi -e 's|^extension=imagick.so|;extension=imagick.so|' ${EXTENSION_INT_PHP_INI}

and

echo "extension=imagick.so" >> ${EXTENSION_INT_EXT_INI}

So at some point it will insert it. But it didn't do it for mine.

It's a Debian 8 box.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
I think the extension needs to be in the php.ini. Did you check the right php.ini (as there are many usually).
Directadmin only uses /usr/local/lib/php.ini on Centos servers, however on our newly installed Centos 7 server that is also the only one present from DA, there are 2 others from plugins which do not contain it either:
Code:
[root@server24: ~]# locate php.ini
/usr/local/directadmin/plugins/softaculous/php.ini
/usr/local/lib/php.ini
/usr/local/mediacp/php/php.ini
[root@server24: ~]# cat /usr/local/directadmin/plugins/softaculous/php.ini | grep imagick
[root@server24: ~]# cat /usr/local/lib/php.ini | grep imagick                               
[root@server24: ~]# cat /usr/local/mediacp/php/php.ini | grep imagick             
[root@server24: ~]#
I also checked inside the DA php.ini just to be sure.

So if it should be added (due to that line) it's not added on Centos 7, but it is visible in a phpinfo.php file.

I do see this however:
Code:
/usr/local/lib/php/extensions/no-debug-non-zts-20170718/imagick.so
The extension dir is not enabled but maybe it's loaded because it's present in this extension directory? Or do you have it present there also on Debian 8?
 

Arieh

Verified User
Joined
May 27, 2008
Messages
1,200
Location
The Netherlands
I used 2 php versions of which 1 mod_php and 2 php-fpm. For mod_php I already had imagick installed. When running ./build imagick, as far I could see it build imagick for my php-fpm version.

I then added the .so linking in /usr/local/php73/lib/php.ini

Well, maybe it's because of the different PHP versions and methods. Either way it may just be a recommendation to try if imagick isn't working.
 
Top