ImageMagick and Ghostscript playing nice with web applications

Development,linux,open source 20 November 2009 | 24 Comments

I had to spent way too much time the last time to set up ImageMagick and Ghostscript together that I simply jump right in so you don’t have to waste time on this, like I did.

Creating thumbnails and images from a PDF is one of the most used features within Razuna. But the other day, when we run the normal convert command we were faced with an error message within our web application of:

Error: Uncaught exception ‘ImagickException’ with message ‘Postscript delegate failed....: No such file or directory

Of course, the first thing I did was to see if we have a error in the shell. Strangely, there was NO error when running the same command in the shell! Needless to say, I spent many hours looking for a solution, trying out different things from reinstalling ImageMagick and Ghostscript to looking all over the web for an answer.

In the end, it boiled down to that web applications (be it CFML, PHP, etc.), are looking for a different executable path then when you run command from the shell. Since Ghostscript installed the executable in the “/usr/local/bin/gs” path the web application could not find it. So the solution to “hours of pain” was to simply create a symbolic link to the “gs” library in the “/usr/bin” directory with:

ln -s /usr/local/bin/gs /usr/bin/gs

Hope this helps the next seeker!

Tagged in , , , , , , , , , , , , ,

24 Responses on “ImageMagick and Ghostscript playing nice with web applications”

  1. Mikael says:

    Had exactly the same problem on a Mac OSX Snow leopard calling imagemagick from Java. Thanks a lot for this post. It did the trick!

  2. uoyyuilnho says:

    lJJXWk kmvbstzwoadb, [url=http://vnnyvatrqldr.com/]vnnyvatrqldr[/url], [link=http://regromqgbbnb.com/]regromqgbbnb[/link], http://etljlkkkyoxa.com/

  3. oldmanrivah says:

    OMG, thank you so much!!!

  4. George Bush says:

    Boluanon http://11111kljbghy.com ## 222222 [url=http://33333hdhkji.com]333333[/url] Asya

  5. URL says:

    Afrygica clomid, B-), sibutramine, yrs, valium no prescription, niobe, nexium, fluffy, effexor generic, nina, Norivini

  6. Go says:

    Austrevaia ambien next day delivery, gleam, buy meridia, trfniih, valium online, 8, nexium, courageous, bupropion, bond, Segantene

  7. URL says:

    Sparynea diazepam online, witty, buy klonopin online, dry, order zolpidem, toodmif, vicodin, secure, buy lorazepam, spans, Euphyrius

  8. Home says:

    Ibesova propecia canada cheap, can, valium online, tasty, cheap meridia, faithful, nexium, wily, imitrex, mnfvirr, Salasur

  9. Home says:

    Eresa <a href="#top”>http://my.speedtv.com/ktrush, toby,<a href="#top”>http://my.speedtv.com/dehunt, gilt, <a href="#top”>http://my.speedtv.com/wbailey, 21, <a href="#top”>http://my.speedtv.com/daikens, mv, <a href="#top”>http://my.speedtv.com/bhuson, 100%, Dalundias

  10. Link says:

    Austratius meridia, while, Aquarnini

  11. Well, this is my primary check out for your webpage! We’re a group of volunteers and commencing a brand new initiative in a community in the identical niche. Your weblog offered us useful data to work on. You have done a marvellous occupation!

  12. Random question: I am starting my own blog to share my photography experiences. Do you find it hard or easy to post consistently?

  13. Such a really good discussion you all have happening. I like the mix of good and correct information together with a few intellectual thoughts. It really is wonderful to be able to finally come across excellent articles where I think I could believe in the text as well as respect the individuals that publish it. With all the web waste nowadays I always value finding some real voices online. Thank you for posting and continue the good work, please!!

  14. A couple of weeks ago i downloaded Tom Clancy’s Ghost Recon Advanced Warfighter 2 Torrent from http://www.games-iso.com and, even though its a really OLD game, its simply the best PC game ever made in my opinion

  15. I was so frustrated beacuse I couldn`t resolve this issue. Then I found your site in google and problem is solved. Thanks!

  16. found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later

  17. Searching for this for some time now – i guess luck is a lot more advanced than search engines :)

  18. Buy Xenical says:

    the expendables was a great movie i thought you all should know

Leave a Reply