PDF to JPG not working from php front end

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF to JPG not working from php front end

Post by snibgo »

fmw42 wrote:If you see gs under delegates from convert -version or convert -list configure, then Imagemagick should be seeing it.
"convert -list configure" shows the contents of delegates.xml. It doesn't check that each program is available.

This can be easily shown: put an entry in delegates.xml that refers to a program that doesn't exist.
snibgo's IM pages: im.snibgo.com
danfar
Posts: 23
Joined: 2014-12-08T08:22:45-07:00
Authentication code: 6789

Re: PDF to JPG not working from php front end

Post by danfar »

if I run, i see this which clearly shows i have gs in there
convert -list configure | grep DELEGATES => DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG not working from php front end

Post by fmw42 »

User snibgo, says that it is only showing delegates listed in delegates.xml and not those that IM actually finds installed. So if you have a current version of IM use the delegates list from convert -version as a list of what IM recognizes as installed. Older versions of IM will not list the delegates when you do convert -version.

I still believe it is some configuration of your OS or PHP that does not let Imagick (not Imagemagick) know you have GS installed or that your PHP Imagick is using a different installation of Imagemagick. Check to be sure phpinfo.php shows the same version of Imagemagick as you think you are using. There could be different versions of Imagemagick installed in different locations.

You can also try at the terminal or via PHP exec()

type -a convert

and see if that shows more than one Imagemagick.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF to JPG not working from php front end

Post by snibgo »

My comments apply only to current IM. I have no idea about v6.5.4-7.
danfar wrote:<?php
exec("/usr/bin/convert test.pdf jastest123.jpg");
?>
If PHP can't find convert by itself, then how will it find Ghostscript? I suggest (again) a PHP configuration problem.
snibgo's IM pages: im.snibgo.com
danfar
Posts: 23
Joined: 2014-12-08T08:22:45-07:00
Authentication code: 6789

Re: PDF to JPG not working from php front end

Post by danfar »

this is what the phpinfo file shows - ImageMagick 6.5.4-7 2014-02-10 Q16 OpenMP http://www.imagemagick.org and its the same ver.

i have imagemagick and imagick both in different folders is these two different things?

can I hire you to fix this for me
thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG not working from php front end

Post by fmw42 »

Imagick and Imagemagick are two different things. If you use PHP and exec(), you are not using Imagick and this topic is posted to the wrong forum. Which are you trying to use?

I am not a PHP expert. So you might have to find some one else.

Does phpinfo show Ghostscript?

What do you get from PHP when you run exec with the following?

exec("type -a convert");
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG not working from php front end

Post by fmw42 »

You say this works in the terminal

convert test.pdf test123.jpg

But does this work

/usr/bin/convert test.pdf test123.jpg

In your terminal type

type -a convert

and see if you have more than one version of IM
danfar
Posts: 23
Joined: 2014-12-08T08:22:45-07:00
Authentication code: 6789

Re: PDF to JPG not working from php front end

Post by danfar »

my phpinfo doesnt show ghostscript - is it supposed to?
---
when i do <?php
exec("type -a convert");
?>
i get a blank page
-----
when i do
In your terminal type
type -a convert
I get /usr/bin/convert
and see if you have more than one version of IM - No I dont see any more ver.
----
But does this work - YES it works
/usr/bin/convert test.pdf test123.jpg
------
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG not working from php front end

Post by fmw42 »

I am at a loss to know what to tell you. Have you discussed this with your ISP?
danfar
Posts: 23
Joined: 2014-12-08T08:22:45-07:00
Authentication code: 6789

Re: PDF to JPG not working from php front end

Post by danfar »

its digitalocean they dont support any questions
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: PDF to JPG not working from php front end

Post by Bonzo »

Is there anything tying you to digitalocean as there are plenty of other hosts around. But saying that it can be hard to find one that is running an up to date version of imagemagick.
danfar
Posts: 23
Joined: 2014-12-08T08:22:45-07:00
Authentication code: 6789

Re: PDF to JPG not working from php front end

Post by danfar »

cheap / performance - but i have ssh so can Install whatever i want - whats the best way to delete the current and install fresh with latest products

ssh command line would be good ( that I can just type and it gets it from URL) im not comfortable with downloading and then unzipping stuff

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

Re: PDF to JPG not working from php front end

Post by Bonzo »

I always get my hosts to do it now as in the past I had to install on three different servers and I had a success rate of 33.3%
danfar
Posts: 23
Joined: 2014-12-08T08:22:45-07:00
Authentication code: 6789

Re: PDF to JPG not working from php front end

Post by danfar »

nothing? anyone?

also should the phpinfo file have ghostscript in it?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF to JPG not working from php front end

Post by snibgo »

Within PHP, what is the value of $PATH? Is Ghostscript on the path? Can other binaries be run from within PHP?
snibgo's IM pages: im.snibgo.com
Post Reply