When I try to convert the first page of a PDF into JPG through PHP imagick, I get an HTTP 500 error with no log in php_errors.log.
Explanation from IIS: The FastCGI process exited unexpectedly
Error code: 0xc0000417
Two files are created in C:\Windows\Temp
, the first one is the PDF read; the other is 0 Kb length.
I am able to perform command line conversions with ImageMagick (convert some.pdf some.jpg). So, ImageMagick and GhostScript are running fine. Also, I am able tho convert between JPG and GIF from PHP scripts.
PHP code:
$im = new Imagick();
$im->setResolution(300,300);
$im->readimage('poster.pdf[0]');
$im->setImageFormat('jpeg');
$im->writeImage('poster.jpg');
$im->clear();
$im->destroy();
My environment:
- Windows 7 Professional 64 bit
- IIS 7.5
- PHP 5.3.6 NTS VC9 via FastCGI
- PHP imagick extension v.3.1.2 (5.3 NTS VC9 x86, from PECL)
- ImageMagick-6.7.7-0-Q16-windows-dll (x86)
- GhostScript 9.07 win32 (x86)
- Microsoft Visual C++ 2008 redistributable x86
- Path to ImageMagick added to PATH environment variable
- Permissions granted to IUSR and IIS_IUSRS in folders
C:\Windows\Temp
andC:\imagemagick
.
So, can anyone give me some guidance to debug this error and have the thing running?