convert not found

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mukeshs
Posts: 2
Joined: 2014-06-03T06:16:42-07:00
Authentication code: 6789

convert not found

Post by mukeshs »

Hi,

I'm using the image magic for the image crop and resize. when i was uploaded code to my client server and try to upload the image then error log show me message like "
convert not found "

I use the bellow code in my php file to execute

$convertthumb ="convert ".$path.$fileName." -resize ".$widths." -gravity Center ".$userthumb."";
exec("".$convertthumb."");

error log show me the message

[Tue Jun 03 06:12:18 2014] [error] [client] sh: , referer: http://example.com/users/edit-profile-pic
[Tue Jun 03 06:12:18 2014] [error] [client] convert: not found, referer: http://example.com/users/edit-profile-pic
[Tue Jun 03 06:12:18 2014] [error] [client] , referer: http://example.com/users/edit-profile-pic
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert not found

Post by Bonzo »

You probably need to specify the full path to convert; run this code to see what it is:

Code: Select all

<?php
echo "<pre>";
system("type convert"); 
echo "</pre>";
//Alternative method
echo "<pre>";
system('which convert',$path); print_r($path); 
echo "</pre>";
?>
mukeshs
Posts: 2
Joined: 2014-06-03T06:16:42-07:00
Authentication code: 6789

Re: convert not found

Post by mukeshs »

Hi There,

I have run the code and its show me the out put

convert: not found.

Can you please guide me what should I need to activate or enable the convert function.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: convert not found

Post by Bonzo »

I would guess Imagemagick is not installed or not correctly installed.
Check with your hosts and see if it is installed and if not; if they will install it for you.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert not found

Post by fmw42 »

Bonzo wrote:I would guess Imagemagick is not installed or not correctly installed.
Check with your hosts and see if it is installed and if not; if they will install it for you.

Or ask them where it is installed -- get the path to where it is installed and use that before convert as path2/convert

It may be installed but PHP exec() does not know where that is.
Post Reply