Page 1 of 1

Windows Application Faulting Event from php calling new Imagick($pdfFn);

Posted: 2020-02-14T13:12:29-07:00
by Abe2020
Hi, I have a windows environment running php7.0.33 against an install of ImageMagick from https://mlocati.github.io/articles/php- ... agick.html (php_imagick-3.4.3-7.0-ts-vc14-x64.zip and ImageMagick-6.9.3-7-vc14-x64.zip), and when I run a simple test for Imagick it works "Ok".

But when I try to run it with a small PDF file (577K), using the php command below..

Code: Select all

$pdfFn="C:/wamp64/tmp/php57DE.pdf";
$im = new Imagick($pdfFn);
.... it blows up with a Windows Application Error seen in the Windows Events log viewer app - reading:

Code: Select all

Faulting application name: httpd.exe, version: 2.4.41.0, time stamp: 0x5d4d8786
Faulting module name: gsdll64.dll, version: 0.0.9.50, time stamp: 0x5da590fb
Exception code: 0xc0000005
Faulting process id: 0x2a10
Faulting application start time: 0x01d5e36adaf5c259
Faulting application path: C:\wamp64\bin\apache\apache2.4.41\bin\httpd.exe
Faulting module path: C:\Program Files\gs\gs9.50\bin\gsdll64.dll
Report Id: 3699c988-8148-49df-b83d-75c8facb73c6
Faulting package full name: 
Faulting package-relative application ID: 
(and the PHP stops completely - the code is actually in a try catch, but the catch doesn't run)


Does anyone know why this should fail? (Note, on a Linux install - the same PDF works ok)

Thanks
Abe

Re: Windows Application Faulting Event from php calling new Imagick($pdfFn);

Posted: 2020-02-14T13:28:46-07:00
by fmw42
Imagemagick 6.9.3.7 is ancient. That could be part of the issue.

But, mainly, you need to have Ghostscript installed where Imagemagick and PHP can find it. Often you need to edit the delegates.xml file to put the full path to gs in the command=""gs" for PHP to find it.

You may also have to edit the policy.xml file to give permissions for reading PDF.

Re: Windows Application Faulting Event from php calling new Imagick($pdfFn);

Posted: 2020-02-14T13:39:04-07:00
by dlemstra
Your ImageMagick version does not work with such a recent version of GhostScript because the behavior of that library was changed (more details here: https://github.com/ImageMagick/ImageMagick/pull/1538). You will either need to upgrade ImageMagick or downgrade GhostScript.

Re: Windows Application Faulting Event from php calling new Imagick($pdfFn);

Posted: 2020-02-14T14:17:22-07:00
by Abe2020
Thanks - I was using the only half-useful installation documentation I could find (https://mlocati.github.io/articles/php- ... agick.html), but if that is not up to date then I'm not sure where I should go for a newer version of ImageMagick [that works with php7.0) - can you suggest where to find more up to date install documentation?

(I'm not sure what the "delegates.xml" file is - I've searched my C drive and cannot find any existence of it)

Thanks
Abe