coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: Urge on June 19, 2005, 05:12:46 AM

Title: Cannot execute ImageMagick
Post by: Urge on June 19, 2005, 05:12:46 AM
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?
Title: Re: Cannot execute ImageMagick
Post by: kegobeer on June 19, 2005, 01:47:03 PM
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.
Title: Re: Cannot execute ImageMagick
Post by: Urge on June 19, 2005, 05:44:01 PM
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.
Title: Re: Cannot execute ImageMagick
Post by: kegobeer on June 19, 2005, 06:50:25 PM
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.
Title: Re: Cannot execute ImageMagick
Post by: Urge on June 20, 2005, 12:27:56 AM
This is the added text:

albums / userpics
/ /

Showed between the header image and the next table.  Screenshot avail upon request.
Title: Re: Cannot execute ImageMagick
Post by: kegobeer on June 20, 2005, 01:16:08 AM
Back to the new file you made:  add this

echo 'Errors: ' . $errors;

before

?>

The page was blank because the error message was never echoed.
Title: Re: Cannot execute ImageMagick
Post by: Urge on June 20, 2005, 01:55:52 AM
That echo didnt echo anything:

< img removed >
Title: Re: Cannot execute ImageMagick
Post by: kegobeer on June 20, 2005, 01:58:20 AM
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;
?>
Title: Re: Cannot execute ImageMagick
Post by: Urge on June 20, 2005, 04:17:11 AM
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.
Title: Re: Cannot execute ImageMagick
Post by: kegobeer on June 20, 2005, 05:30:24 AM
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.