Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out if I have gd library or imagemagick installed?

Tags:

This might seem a really stupid question. I am new php image processing. I assume there are only two imageprocessing libraries in php. They are called GD/GD2 and Imagemagick. How do I know which I have installed? or if I have installed any? I have echo-ed phpinfo. It just says that GD imaging was created by Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger. I am really confused. Thanks in advance.

like image 989
odbhut.shei.chhele Avatar asked Aug 27 '14 18:08

odbhut.shei.chhele


People also ask

How do I know if GD library is installed?

Yes, GD library is already installed on all of our servers. You can verify this information by checking in your phpinfo. php page.

How do I know if PHP imagick is installed?

echo "Version return code is $rcode <br>"; //Print the return code: 0 if OK, nonzero if error. echo alist($out); //Print the output of "convert -version" echo '<br>'; echo '<b>This should test for ImageMagick version 5.

What is GD library with example?

GD is an open source code library for the dynamic creation of images. GD is used for creating PNG, JPEG and GIF images and is commonly used to generate charts, graphics, thumbnails on the fly. While not restricted to use on the web, the most common applications of GD involve web site development.


2 Answers

If you can get to the console of the server running PHP, type:

php -i | grep 'GD\|ImageMagick' 

This will tell you if GD or ImageMagick is installed and running.

like image 197
Michael Berry Avatar answered Oct 02 '22 08:10

Michael Berry


This is also a good answer that helped me. Thank you @Class

if(extension_loaded('gd')){/*loaded*/} 
like image 36
Yevgeniy Afanasyev Avatar answered Oct 02 '22 08:10

Yevgeniy Afanasyev