Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Cannot execute ImageMagick  (Read 4611 times)

0 Members and 1 Guest are viewing this topic.

Urge

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Cannot execute ImageMagick
« 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?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Cannot execute ImageMagick
« Reply #1 on: June 19, 2005, 01:47:03 pm »

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

Code: [Select]
            $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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cannot execute ImageMagick
« Reply #2 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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Cannot execute ImageMagick
« Reply #3 on: June 19, 2005, 06:50:25 pm »

In install.php, after

Code: [Select]
            $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

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

Run install.php again.  Report the results.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cannot execute ImageMagick
« Reply #4 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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Cannot execute ImageMagick
« Reply #5 on: June 20, 2005, 01:16:08 am »

Back to the new file you made:  add this

Code: [Select]
echo 'Errors: ' . $errors;
before

Code: [Select]
?>
The page was blank because the error message was never echoed.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cannot execute ImageMagick
« Reply #6 on: June 20, 2005, 01:55:52 am »

That echo didnt echo anything:

< img removed >
« Last Edit: June 20, 2005, 04:22:34 am by Urge »
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Cannot execute ImageMagick
« Reply #7 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.

Code: [Select]
<?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;
?>
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Cannot execute ImageMagick
« Reply #8 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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Cannot execute ImageMagick
« Reply #9 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.
Logged
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
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 16 queries.