Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageMagick Installed, True or False, How to Check? PHP [duplicate]

I have to run a function that has an option to use GD or ImageMagick - what is the best way (php) to test if ImageMagick is installed, and return a true or false?

like image 353
Orangeman555 Avatar asked May 03 '13 06:05

Orangeman555


People also ask

How enable imagick in PHP INI?

To enable Imagick for your website, go to your Site Tools -> Dev -> PHP Manager. Click the PHP Extensions tab and find the entry for the “imagick” extension in the list that appears. Then click the Change value button (pencil icon), select the On radio button for Status and save the changes.

Where is imagick installed?

By default, ImageMagick is installs binaries in /../usr/local/bin , libraries in /../usr/local/lib , header files in /../usr/local/include and documentation in /../usr/local/share . You can specify an alternative installation prefix other than /../usr/local by giving configure the option --prefix=PATH .

How do I know ImageMagick version?

The Imagick::getVersion() function is an inbuilt function in PHP which is used to get the ImageMagick API version. Parameters: This function does not accept any parameter. Return Value: This function returns the ImageMagick API version.


1 Answers

Use an if condition with extension_loaded() function to check whether you have the extension is loaded

if(extension_loaded('imagick')) {
    echo 'Imagick Loaded';
}

Documentation

like image 189
Mr. Alien Avatar answered Sep 27 '22 21:09

Mr. Alien