php-如何解决imagemagick中的错误Imagick :: textureImage?

i am having this code when i try to run it show error...

MY CODE

<?php
$image = new Imagick();
$image->newImage(500, 500, new ImagickPixel('red'));
$image->setImageFormat("png");
$type=$image->getFormat();
header("Content-type: $type");

$texture = new Imagick();
$texture->readImage('texture.png');
$image = $image->textureImage($texture);

echo $image;
    ?>

ERROR

Fatal error: Uncaught exception 'ImagickException' with message 'RegistryKeyLookupFailed `CoderModulesPath' @ error/module.c/GetMagickModulePath/673' in C:\xampp\htdocs\t1\e3.php:5 Stack trace: #0 C:\xampp\htdocs\t1\e3.php(5): Imagick->setimageformat('png') #1 {main} thrown in C:\xampp\htdocs\t1\e3.php on line 5

how to resolve it .