2

I'm trying to run the following command:

"C:\Program Files\ImageMagick-7.0.3-Q16\magick" convert "G:\path\to\filename.pdf[1]" -colorspace RGB -geometry 800 "g:\path\to\temp\filename.png"

It runs great if I run it via cmd while I'm logged in but if I try to run it via IIS / PHP / exec it doesn't work. I get the following error instead:

convert: no images defined `g:\path\to\temp\filename.png' @ error/convert.c/ConvertImageCommand/3254.

I've given Full Control permission to g:\path\to\temp to IUSR, IIS_USERS, ANONYMOUS LOGIN and Everyone. Nothing works.

I do exec('echo %username%') and see that the currently logged in user via IIS is COMPUTER$ but that doesn't really help me.

edit:

I've given "Everyone" Full Control permission in C:\Program Files (x86)\gs\gs9.09\bin and C:\Program Files\ImageMagick-7.0.3-Q16 and still get the same thing.

edit 2:

To whoever flagged my question as a duplicate of Can't convert PDF into image, because of 'no images defined' error ... it is not. First, I am running Windows - not Linux - so obviously which gs is not going to work. Second, in my case, convert works just fine when I run it via cmd.exe. But when I try to run it via IIS / PHP / exec() it does not work. In the other question it didn't work at all. Period.

edit 3:

I also tried to create a new application pool with "LocalSystem" per https://stackoverflow.com/a/23046001/569976. Nothing.

neubert
  • 7,574
  • 39
  • 94
  • 156

1 Answers1

0

I got this working by just installing WAMP. So IIS is running on port 80 / 443 and WAMP is running on port 81 / 444.

neubert
  • 7,574
  • 39
  • 94
  • 156