Page 1 of 1
Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 5:50 am
by owsdeveloper
I was up to speed with PHP a few years ago but got sidetracked. I a now getting back into it but am quite rusty so some help would be greatly appreciated.
Right, here is my problem:
The web hosting i use has apparently got Imagemagick installed. The most information i can get from them is that "We do support imagemagick and it is installed already on the server. The path is /usr/bin/convert." They then i could try "/usr/bin".
When i try to run the following script:
<?php
$image = new imagick( "image/service/consult.jpg" );
$points = array(
0,0, 25,25, # top left
176,0, 126,0, # top right
0,135, 0,105, # bottom right
176,135, 176,135 # bottum left
);
$image->setimagebackgroundcolor("#fad888");
$image->setImageVirtualPixelMethod( imagick::VIRTUALPIXELMETHOD_BACKGROUND );
$image->distortImage( Imagick::DISTORTION_PERSPECTIVE, $points, TRUE );
header( "Content-Type: image/jpeg" );
echo $image;
?>
I get this error:
Fatal error: Class 'imagick' not found in /home/design/public_html/script/image/manipulate.php on line 11
Can anyone tell me how i can make use of the information "The path is /usr/bin/convert"?
If you want i can create a testing domain for you so you can try it out directly.
Thanks in advance for any help

Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 10:55 am
by twinedev
When they told you imagemagick was installed, were they referring to both the program and the PHP extensions, or just the actual program?
I myself have never used the extension, and instead am used to using the system() function to execute it via command line.
I am going to look to see if my own server has the imagemagick extention installed and play with it.
-Greg
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:00 am
by owsdeveloper
Thanks for your reply twinedev, i dont think the person in support at my host has enough knowledge to provide proper answers.
He simply says "We do support imagemagick and it is installed already on the server
The path is /usr/bin/convert. I hope this helps.
Let us know if you've any other questions or need further assistance."
i could create an account for you if you want to try it there?
Dean
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:08 am
by genix2011
Hi,
from the php error it is quite clear, that the imagemagick php extension is not installed on the server, there is just the normal imagemagick program installed.
You could use the system() function to access the imagemagic program.
But if they say, that imagemagick is supported, they should also install the imagemagick php extension.
Greets.
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:10 am
by Celauran
I just installed imagick and its PHP extension on my test machine and your code is working fine. Have you checked through your server's phpinfo() to verify that the PHP imagick extension is, in fact, there?
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:24 am
by owsdeveloper
i checked phpinfo, cant see it, its here if you dont mind doublechecking for me:
http://design.openwebservices.co.uk/phpinfo.php
how do i use the system function? can you give me a couple of simple examples and i will work it out from there?
As i said, im just getting back into php coding so need a few pointers.
thanks
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:30 am
by owsdeveloper
apparently system() has been disables on the server:
Warning: system() has been disabled for security reasons in /home/design/public_html/imagicktest.php on line 12
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:32 am
by Celauran
If they've disabled system() and they don't have the imagick php extension (I double checked your phpinfo() -- they don't), they essentially don't have imagick available to you.
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:37 am
by owsdeveloper
am i right in thinking the information they gave me "The path is /usr/bin/convert" is of no use to me in solving this? The only way to fix this is if they install the imagick php extension? if so i am going to contact them to see if they will install it...
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:39 am
by owsdeveloper
they now say:
"Try using /usr/local/bin/convert as the path, if /usr/bin/convert is not working."
they say use it as the path - where/how do i use this path?
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 11:40 am
by Celauran
With system() disabled, I don't see how that's of any use to you.
Re: Need Help Accessing Imagemagick!!!
Posted: Fri Aug 19, 2011 9:18 pm
by owsdeveloper
i got on to the hosting company and they have installed the php extension so hopefully i can get some results now.
Thanks for the advice/help guys.
Dean