mesnicka
mesnicka

Reputation: 2548

PHP imagick searches for modules/coders in wrong path

I've installed ImageMagick, PHP Imagick, Ghostscript on my Windows Server. Everything works fine by cmd prompt and by php exec() function. But it doesn't work via Imagick Class. This part of code:

$im = new Imagick();
$im->setFormat('PNG');
$im->readImageBlob($this->config->item('system_path')."ftp/MAKRO-INFO/x1.png");

returns ImagickException:

Fatal error: Uncaught exception 'ImagickException' with message 'unable to load module `C:\Windows\system32\config\systemprofile\.magick\IM_MOD_RL_PNG_.dll': An unknown error occurred @ error/module.c/OpenModule/1282'

I am very surprised why is Imagick searching for modules in windows/system32/ directory. Of course it doesn't work when access to this path is denied.

My question is, where/how can I change this path (configuration file, registry or enviroment variables)?

This is my phpinfo. As you can see, no modules have been loaded (0 supported formats).

enter image description here

and PATHs: enter image description here

Upvotes: 0

Views: 931

Answers (1)

mesnicka
mesnicka

Reputation: 2548

Found the solution. There was a collision between ImageMagick version and PHP imagick version.

I used these versions:

ImageMagick-6.8.0-3-Q16

php_imagick-3.2.0RC1-5.4-nts-vc9-x86

Upvotes: 0

Related Questions