I have a php script that uses imagick to get image colors among other things.
php /home/username/public_html/cron.php
I would get this error on the scheduled run
[30-Apr-2013 00:00:02] PHP Fatal error: Class 'Imagick' not found in /home/username/public_html/cron.php on line 113
A sample of the php code:
try {
$image = new Imagick($filename);
$image->scaleImage(1,1);
$pixel = $image->getImagePixelColor(1, 1);
$color = $pixel->getColor();
$image_r = $color['r'];
$image_g = $color['g'];
$image_b = $color['b'];
$image->destroy();
} catch (ImagickException $e) {
// something went wrong, handle the problem
$image_r = 0;
$image_g = 0;
$image_b = 0;
}
Do I need set up some environmental variable so it knows where to look for imagick? It works fine if I invoke the php script from the browser. Hopefully I can move this script out of the public_html when I have it working so I don't get a third party calling it.
thanks.