Please identify your version of Imagemagick and provide if possible the input image. You can upload to dropbox.com (public folder) and put a link here to it.
Is the file you downloaded ending in .sh? If so, you need to either remove the .sh or include .sh in the call to it as unrotate.sh
Did you follow the pointers on my home page? Where is Imagemagick installed? Is it in your $PATH?
To locate where IM is installed, try typing the following in a terminal window.
I have no problem with running my test image. Try testing with one of my examples. If your background is not constant or to remove an antialiasing between the image and background, add -f argument as in my example page. This is especially needed for jpg images that do give pure constant background colors and/or if from a scanner.
I am really new to linux, so I do not know how to check if IM is in $PATH or how to add it there. Neither how to check the version of IM.
I tried my file with JqMagick and now I know unrotate is not the tool of choice for my image (trying to align a photographed document so I can run an OCR software and have a .pdf). Propably deskew would be better. Could you tell me what the command line has to look like?
If unrotate does not help, then -deskew probably will not help, either.
Upload your image to say dropbox.com (public folder) or any free image hosting service and put the URL here. Then I can see what you are trying to do and perhaps offer solution and some IM commands.
The first thing is to get your PHP command to recognize IM.
Try this
<?php
exec("convert -version",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
If that works, then IM is in your path. If not, then try this
<?php
exec("/usr/bin/convert -version",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
Let me know what is returned.
P.S. Are you running on your own local computer or on a server hosted by some ISP?