ImageMagick and Ghostscript playing nice with web applications

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!

Looking for a Chromebook? Get this instead
The following is my personal opinion. I'm not affiliated with any of the companies mentioned below, nor did anyone pay me for this post. Are you currently looking for a Chromebook? Maybe the new Samsung Chromebook or the latest Pixelbook Go? Is the device you are looking at coming with…

How to create a virtual machine server image from a physical CentOS server
I run a couple of servers over at a server farm. All of those machines run VMWare ESX, so today I wanted to move my last physical server to a VMWare image. If you want to convert a physical Windows machine then your task is quite easy. Start up the…

Fix for running MySQL 5.5.8 under MacOS X 10.6.5 (Snow Leopard)
Oracle recently released the latest MySQL 5.5.x versions. Despite of having tones of fixes and supposedly running much faster and (finally) making InnoDB the default storage engine, it is always good to keep up to date with latest releases. But, as in the past, MaxOS X users always have to…

Updating Confluence and Jira is a nightmare and keeps you hunting for solutions
First off, I really like Jira and Confluence and we have been using them successfully for all our open source applications. We also use HipChat for our IM communication and use SourceTree for managing code on Github. Just realised that Atlassian has become a company to depend on... This post…

svn: warning: cannot set LC_CTYPE locale
Somehow with the recent Ubuntu 10.04 LTS updates or maybe with a subversion update, I received some errors message of the type "locale...". To be more precise the errors are; svn: warning: cannot set LC_CTYPE locale svn: warning: environment variable LC_CTYPE is UTF-8 svn: warning: please check that your locale…

Nginx error with Tomcat - upstream sent too big header while reading response header from upstream
Nginx is our favorite web server currently as it is fast, lean and easy to configure. Performance is just outstanding and if you haven't take a look at it. One thing that I noticed while we deployed Nginx with Tomcat is that their default size for the buffers are very…