Page 1 of 1

Re: Imagemagick usage without PHP exec function

Posted: 2009-03-21T09:35:48-07:00
by fmw42
HarPaddy wrote:Hi.

I have a problem with imagemagick.

Imagemagick has been installed on my server, but "exec()" has been disabled for some security reasons . I am having FastCGI has been enabled on server and i can use binary conversion of imagemagick.

Can u please help me how to generate thumbnails using imagemagick with PHP functions without using "exec()" command? I am struggling with this from long time. Please help me out.

Thanks,
HarPaddy
I am not an expert with PHP, but first you need to know where IM is installed, usually /usr/local/bin or /usr/local.

Then try using either system or shell exec:

<?php
system("/usr/local/bin/convert -version");
?>


or

<?php
$IM_version=shell_exec("/usr/local/bin/convert -version");
echo $IM_version
?>

Do either of those return the IM version?

Re: Imagemagick usage without PHP exec function

Posted: 2009-03-23T15:10:08-07:00
by Bonzo
If fmw42's ideas do not work you could see if Imagick is installed by trying one of their examples:

Code: Select all

<?php 
$thumbnail = new Imagick("input_image.jpg");
$thumbnail->thumbnailImage( 100, 0 );
$thumbnail->writeImage( "thumbnail.jpg" );
?> 
You should probably be posting this in the Users section of the forum.