Page 1 of 1

convert not found

Posted: 2014-06-03T06:27:50-07:00
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

Re: convert not found

Posted: 2014-06-03T07:17:03-07:00
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>";
?>

Re: convert not found

Posted: 2014-06-03T21:56:39-07:00
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.

Re: convert not found

Posted: 2014-06-04T00:00:59-07:00
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.

Re: convert not found

Posted: 2014-06-04T09:45:06-07:00
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.