Hello, I am having some difficulty with a local install of ghostscript on 1&1 host. I installed ImageMagick first, corrected paths to my local install directory, and verified that I could convert files. I cannot, however, get ghostscript to also work (by way of converting a PDF to a JPG).
Bash error is simply: gs: command not found
I have gone into the delegates.xml file both in the /config and /lib/ImageMagick-6.6.5/config folders to correct the path to my local installation path of the gs binary. I have also tried creating a symbolic link to the gs binary but I'm not convinced I have executed that correctly.
Can anyone lend some advice on getting ImageMagick (installed locally) to pick up Ghostscript (installed locally)? Are there other locations that I need to correct for the ghostscript path? On an ImageMagick configure, Ghostscript is listed as NONE.
Any help appreciated.
Ghostscript install
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Ghostscript install
Best idea is to install ghostscritp first, then install IM. The Im build will then set up delegates correctly.
Note the "gs" command is generally installed so as to be on the users "path" typically /usr/bin/bin
Note the "gs" command is generally installed so as to be on the users "path" typically /usr/bin/bin
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Ghostscript install
Had a few hiccups reinstalling IM, but once it went clean it did pick up on my ghostscript install. Working now, thanks!
Re: Ghostscript install
While my ImageMagick install is working (and with Ghostscript, thanks again!), I seem to be having a slight issue with environment variables. If I set MAGICK_HOME and PATH through the shell and run a convert everything is fine, otherwise it throws an error loading a library file. The variables get reset when my session ends of course and so it doesn't work when I try to invoke IM through php.
By way of http://212.247.27.201/localdoc/ImageMag ... urces.html (at the bottom), I have added lines for MAGICK_HOME, PATH, and even LD_LIBRARY_PATH in configure.xml, but it doesn't seem to make any difference. Am I missing something really simple here?
Thanks.
By way of http://212.247.27.201/localdoc/ImageMag ... urces.html (at the bottom), I have added lines for MAGICK_HOME, PATH, and even LD_LIBRARY_PATH in configure.xml, but it doesn't seem to make any difference. Am I missing something really simple here?
Thanks.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Ghostscript install
You must make sure the PHP passes the variables as environment variables and not just as oridinary PHP variables. PHP as security limitations in place by default to prevent passing of 'user' environment into web run scripts.
For PHP usage from the web, the IM should be installed as a system installation (without needing MAGICK_HOME environment). Otherwise you need to either fix PHP, or somehow set the environment variables during the 'shell' call to "convert", that however is not recommended as PHP scripts then become less portable.
Alternative you can create a "convert" script that sets the environment, before calling the real convert program. I do something similar myself using a script called "hdri" that sets those same environment variables to switch IM to a HDRI compiled version of IM.
See Creating a Personal ImageMagick
http://www.imagemagick.org/Usage/api/#personal
You can copy the script presented and modify to suit.
For PHP usage from the web, the IM should be installed as a system installation (without needing MAGICK_HOME environment). Otherwise you need to either fix PHP, or somehow set the environment variables during the 'shell' call to "convert", that however is not recommended as PHP scripts then become less portable.
Alternative you can create a "convert" script that sets the environment, before calling the real convert program. I do something similar myself using a script called "hdri" that sets those same environment variables to switch IM to a HDRI compiled version of IM.
See Creating a Personal ImageMagick
http://www.imagemagick.org/Usage/api/#personal
You can copy the script presented and modify to suit.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/