giozh
giozh

Reputation: 10068

check if installed php version support imagick

I had some php files that use imagick for resizing pictures stored on my server and after I changed server, imagick functions stopped working. In fact, if I try to use the scripts for resizing pictures (that works on old server), no resized image is created, and no error messages are showing. How can I check if my hosting support imagick?

Upvotes: 0

Views: 4364

Answers (3)

Luton Datta
Luton Datta

Reputation: 54

echo extension_loaded('imagick') ? "Extension loaded." : "Extension Not loaded";

or

echo class_exists('Imagick') ? "Class Imagick exists." : "Class Imagick Not exists";

Upvotes: -1

Niols
Niols

Reputation: 647

You should check if the imagick extension is installed and loaded.

Here is the documentation for the phpinfo function that should give you the info you're looking for : http://php.net/manual/en/function.phpinfo.php

Simply create a php file containing

<?php
phpinfo ();

and look at what it produces. Don't forget to delete it after this, because it could give a lot of informations about what's running on your server, which is never a good thing.

If you need it, here is the doc for imagicck : http://php.net/manual/en/book.imagick.php

Upvotes: 0

wimg
wimg

Reputation: 347

Run this code :

<?php
if (extension_loaded('imagick')) {
    echo 'Supported';
} else {
    echo 'Not supported';
}

Upvotes: 5

Related Questions