Imagick not loaded when using PHPUnit

When i run my PHPUnit test, I have :

C:\LPAMP\php-7.1.2\php.exe C:\LPAMP\phpunitPhars\phpunit-6.2.2.phar --configuration C:\LPAMP\www\guetzliFolder\tests\phpunitColors.xml --teamcity
Testing started at 10:56 ...
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/LPAMP/php-7.1.2/ext/php_imagick.dll' - Le module sp�cifi� est introuvable.
in Unknown on line 0

When i execute the command ...

C:\LPAMP\php-7.1.2\php.exe C:\LPAMP\phpunitPhars\phpunit-6.2.2.phar --configuration C:\LPAMP\www\guetzliFolder\tests\phpunitColors.xml --teamcity

... in a Windows terminal, it works. So why the extension is not loaded ?

I see it in Project->External Libraries so i don't understand what's wrong :/

0
8 comments
Avatar
Permanently deleted user

Hello,

Where exactly do you see imagick library in External Libraries? PHP Runtime?

If you go to File | Settings | Languages & Frameworks | PHP and press (i) button while correct interpreter is selected, can you see "imagick" in the "Loaded Extensions" list?

0
Avatar
Permanently deleted user

Hello,

Yes it is in External libraries > PHP Runtime. I do not see it in the phpinfo obtained via File | Settings | Languages & Frameworks | PHP.

0
Avatar
Permanently deleted user

I add that it seems to be the same php.ini used and via the terminal (outside PHPStorm) the extension is well loaded (checked with get_loaded_extensions). Really strange.

0

Could you please archive and share the interpreter with us?

0
Avatar
Permanently deleted user
0

Please try to set absolute path to extensions in php.ini, e.g.:

extension=C:/LPAMP/php-7.1.2/ext/php_imagick.dll instead of just extension=php_imagick.dll

0
Avatar
Permanently deleted user

It does not work better with the absolute path. But....

I notice that the imagick module is loaded when i use my ConEmu + Babun environment which is not apparently the case when i look with "php -m" with Windows classic terminal (cmd). So maybe it is a weird problem of path environment variables.

0
Avatar
Permanently deleted user

I reinstalled Imagick to C:/imagemagick but i previously read on an article that i have to copy CORE_RL* files in a folder. I copied those files into the 'AMP' folder like mentioned but it was not the good folder. This time, i put those files into C:/imagemagick replacing the other files and ....now it works :D

0

Please sign in to leave a comment.