Can't exec convert through exec() in php

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
sebtucknott

Can't exec convert through exec() in php

Post by sebtucknott »

Hi Guys,

Really pulling my hair out with this one...

Tried to upgrade my imagemagick from 6.5.5 to 6.6.0 (wish I hadn't bothered now!) and now when I try to run convert through php using exec() I get the following;

Version return code is 127
Array ( [0] => convert: error while loading shared libraries: libMagick.so.10: cannot open shared object file: No such file or directory )

I have tried uninstalling and reinstalling both versions. I am now back to 6.5.5 however still doesn't work.

If I do;

[root@]# convert -version
Version: ImageMagick 6.5.6-6 2010-03-26 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

So imagemagick is working and I can convert images through the command line.

Can anyone please help!

Thanks,

Seb
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Can't exec convert through exec() in php

Post by Bonzo »

I had a similar problem and here is the thread: viewtopic.php?f=1&t=15702

The first 2 lines of code posted by snibgo worked but the second did not.
sebtucknott

Re: Can't exec convert through exec() in php

Post by sebtucknott »

Fixed the problem...

The new version seemed to install in /usr/local/bin rather than /usr/bin like it was before. When calling it from command doesn't seem to make a difference but from exec() you have to use /usr/local/bin

Well I hope this post helps someone else because I was stuck with it for about 6 hours!

Thanks,

Seb
Post Reply