請問一下:
小弟是用yum安裝,然後在用pecl安裝php部份,在php.ini
也加入
extension=imagick.so
不過跑範例
<?php
/* Create a new imagick object */
$im = new Imagick();
/* Create new image. This will be used as fill pattern */
$im->newPseudoImage(50, 50, "gradient:red-black");
/* Create imagickdraw object */
$draw = new ImagickDraw();
/* Start a new pattern called "gradient" */
$draw->pushPattern('gradient', 0, 0, 50, 50);
/* Composite the gradient on the pattern */
$draw->composite(Imagick::COMPOSITE_OVER, 0, 0, 50, 50, $im);
/* Close the pattern */
$draw->popPattern();
/* Use the pattern called "gradient" as the fill */
$draw->setFillPatternURL('#gradient');
/* Set font size to 52 */
$draw->setFontSize(52);
/* Annotate some text */
$draw->annotation(20, 50, "Hello World!");
/* Create a new canvas object and a white image */
$canvas = new Imagick();
$canvas->newImage(350, 70, "white");
/* Draw the ImagickDraw on to the canvas */
$canvas->drawImage($draw);
/* 1px black border around the image */
$canvas->borderImage('black', 1, 1);
/* Set the format to PNG */
$canvas->setImageFormat('png');
/* Output the image */
header("Content-Type: image/png");
echo $canvas;
?>
跑不出來,小弟不知道該怎麼測試?看過phpinfo()感覺沒載入進去log出現
[Wed Mar 11 17:07:04 2009] [error] [client 211.20.61.101] PHP Fatal error: Class 'Imagick' not found in /var/www/html/test/index.php on line 4
找imagick.so在
/usr/lib/php/modules/imagick.so
看起來是對的,請問各位前輩該怎麼驗證我有安裝成功!!