Cannot execute ImageMagick Cannot execute ImageMagick
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Cannot execute ImageMagick

Started by Urge, June 19, 2005, 05:12:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Urge

When trying to install Coppermine, I get this error:

The installer found the ImageMagick 'convert' program in '/usr/local/bin/', however it can't be executed by the script.

There is something flawed with the script.  All of my permissions (file and php) are correct.  How do I know? I made a test script and it returned:

"Version: ImageMagick 6.2.3 06/02/05 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC Usage: convert..." and continues on.

The script was this:

<?php
passthru("/usr/local/bin/convert");
?>

So, why does Coppermine have a problem executing convert?

kegobeer

That does not execute any ImageMagick convert functions.  This is the code:

            $output = array();
            $tst_image = "{$DFLT['alb_d']}/{$DFLT['upl_d']}/im.gif";
            exec ("{$HTTP_POST_VARS['impath']}convert images/nopic.jpg $tst_image", $output, $result);
            $size = getimagesize($tst_image);
            unlink($tst_image);
            $im_installed = ($size[2] == 1);

            if (!$im_installed)
                $errors .= "<hr /><br />The installer found the ImageMagick 'convert' program in '{$HTTP_POST_VARS['impath']}', however it can't be executed by the script.<br /><br />
                                        You may consider using GD instead of ImageMagick.<br /><br />";


Make a new file, edit the above code to use your convert location (/usr/local/bin/), your location to a test image, then execute the script.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Urge

Ok, well here is what I did: Edited the code you gave me for a valid image, which resulted in:

<?php
$output = array();
            $tst_image = "images/goliath.jpg";
            exec ("/usr/local/bin/convert images/nopic.jpg $tst_image", $output, $result);
            $size = getimagesize($tst_image);
            unlink($tst_image);
            $im_installed = ($size[2] == 1);

            if (!$im_installed)
                $errors .= "<hr /><br />The installer found the ImageMagick 'convert' program in

'{$HTTP_POST_VARS['impath']}', however it can't be executed by the script.<br /><br />
                                        You may consider using GD instead of ImageMagick.<br /><br

/>";
?>

And the resulting page was blank, so I'm assuming that meant no errors.

kegobeer

In install.php, after

            $output = array();
            $tst_image = "{$DFLT['alb_d']}/{$DFLT['upl_d']}/im.gif";
            exec ("{$HTTP_POST_VARS['impath']}convert images/nopic.jpg $tst_image", $output, $result);
            $size = getimagesize($tst_image);


add

            echo $DFLT['alb_d'] . ' / ' . $DFLT['upl_d'] . '<br />';
            echo $size[0] . ' / ' . $size[1] . ' / ' . $size[2] . '<br />';


Run install.php again.  Report the results.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Urge

This is the added text:

albums / userpics
/ /

Showed between the header image and the next table.  Screenshot avail upon request.

kegobeer

Back to the new file you made:  add this

echo 'Errors: ' . $errors;

before

?>

The page was blank because the error message was never echoed.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Urge

#6
That echo didnt echo anything:

< img removed >

kegobeer

I don't think you understand my request: you add that echo statement to the new file you created, not install.php.

<?php
 $output 
= array();
            
$tst_image "images/goliath.jpg";
            
exec ("/usr/local/bin/convert images/nopic.jpg $tst_image"$output$result);
            
$size getimagesize($tst_image);
            
unlink($tst_image);
            
$im_installed = ($size[2] == 1);

            if (!
$im_installed)
                
$errors .= "<hr /><br />The installer found the ImageMagick 'convert' program in

'
{$HTTP_POST_VARS['impath']}', however it can't be executed by the script.<br /><br />
                                        You may consider using GD instead of ImageMagick.<br /><br

/>"
;
echo 
'Errors: ' $errors;
?>
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Urge

My apologies, here is the result:

Errors:

The installer found the ImageMagick 'convert' program in '', however it can't be executed by the script.

You may consider using GD instead of ImageMagick.




Which is quite odd, since if i take out that line, it shows noting at all.

kegobeer

Like I said, without the echo you don't know if there are errors.  Obviously, PHP can't execute the convert binary for some reason, most likely a permissions issue.  All I can say is to check out the ImageMagick forum for setup help.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots