Verify ImageMagick installation

前端 未结 10 1515
一个人的身影
一个人的身影 2020-11-29 01:16

My web hosting said ImageMagic has been pre-installed on the server. I did a quick search for \"ImageMagick\" in the output of phpinfo() and I found nothing. I can\'t SSH in

10条回答
  •  春和景丽
    2020-11-29 01:21

    To test only the IMagick PHP extension (not the full ImageMagick suite), save the following as a PHP file (testImagick.php) and then run it from console: php testImagick.php

    newImage(1, 1, new ImagickPixel('#ffffff'));
    $image->setImageFormat('png');
    $pngData = $image->getImagesBlob();
    echo strpos($pngData, "\x89PNG\r\n\x1a\n") === 0 ? 'Ok' : 'Failed';
    echo "\n";
    

    credit: https://mlocati.github.io/articles/php-windows-imagick.html

提交回复
热议问题