• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issues with Plesk Panel and imagick.dll

Cruiser1

New Pleskian
Hello everybody,
I need your support. I'm running Parallels Plesk Panel 12 on Windows Server 2012 R2. Running PHP 5.5.14.

I need to install ImageMagick. I successfully installed ImageMagick 6.7.7-5-Q16 with a proper php_imagick.dll on a Windows Server 2012 without issues.

On the Windows Server 2012 R2 with Plesk Panel I can not get that to work.
It does not appear in the phpinfo although I enabled the extension in the php.ini. I also tried adding it to the websites PHP settings in Plesk Panel but that did not work eighter.

I created a info file with the following content:
PHP:
print_r(get_loaded_extensions());

If I call it via the website, I'll get this response:
Array ( [0] => Core [1] => bcmath [2] => calendar [3] => ctype [4] => date [5] => ereg [6] => filter [7] => ftp [8] => hash [9] => iconv [10] => json [11] => mcrypt [12] => SPL [13] => odbc [14] => pcre [15] => Reflection [16] => session [17] => standard [18] => mysqlnd [19] => tokenizer [20] => zip [21] => zlib [22] => libxml [23] => dom [24] => PDO [25] => openssl [26] => SimpleXML [27] => wddx [28] => xml [29] => xmlreader [30] => xmlwriter [31] => cgi-fcgi [32] => curl [33] => fileinfo [34] => gd [35] => gettext [36] => imap [37] => mbstring [38] => mysql [39] => mysqli [40] => Phar [41] => pdo_mysql [42] => pdo_sqlite [43] => sockets [44] => sqlite3 [45] => xsl [46] => mhash [47] => ionCube Loader [48] => Zend OPcache )

49 extensions, no imagick.

If I call the same php file from the command line, calling the same php-cgi.exe with the same php.ini, I'll get this result:
without_plesk.png

50 extensions, including imagick.

I don't know where the difference is? Why does Plesk fail on using imagick?

Please support me with this issue.

Thanks!
 
Last edited:
Hello IgorG,
first I just added extension=php_imagick.dll to the php.ini as I used to do in the Plesk website configuration (PHP Settings for this domain). Since that did not work, I added it directly into the php.ini at C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php.ini

Today, I changed the content of my php test file to this:
PHP:
try{
$im = new imagick( 'C:\inetpub\vhosts\myserver.net\mydomain\a.jpg' );
// resize by 200 width and keep the ratio
$im->thumbnailImage( 200, 0);
// write to disk
$im->writeImage( 'C:\inetpub\vhosts\myserver.net\mydomain\a_thumbnail.jpg' );
}
catch(exception $e){
echo $e;
}

If I call it via cmd C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\php-cgi.exe it'll work and generate a thumbnail.
If I call it (using relative paths of course) via my web browser, the web brwoser will load forever. No error message, no thumbnail generation.


I investigated further. I'm running PHP 5.5. as FastCGI for this domain via Plesk Panel. If I switch to run PHP 5.5 as CGI, I'll get the following error message, if I run the php test script from the first post:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP55\ext\php_imagick.dll' - Das angegebene Modul wurde nicht gefunden. in Unknown on line 0

The error does not appear on FastCGI but the script does also not work on FastCGI. Of course my PHP settings have been error reporting E-ALL and show_errors on.

Please help me to get this running. I'm out of ideas why this could happen if the imagick library works fine via cmd php-cgi.exe but not via browser access. Plesk must change something in the php.ini...
 
It appears that 'imagick' is not compiled properly with PHP as mentioned on the below link under section 'Install from Windows Source':

http://www.imagemagick.org/script/install-source.php

I would suggest you to compile the module properly because PHP may show the extensions added under it but while browsing via any website, it showing class 'Imagick' not found. This kind of errors generally get generated when the 'Imagick' is not installed properly on the server.
 
Hello Igor,
I took the official extension from here: http://pecl.php.net/package/imagick/3.1.2/windows
It is the 5.5 Non Thread Safe (NTS) x86

And it works if I execute it via cmd php-cgi.exe as described. It even converts a picture and generates the thumbnail. So the error can't be in the dll file, it must be plesk not loading it although it is in the php.ini
 
Okay, this is getting even more weird now. I'm able to reproduce this bug using PHP 5.4 as FastCGI. I installed the proper DLL from http://pecl.php.net/package/imagick/3.1.2/windows (5.4 Non Thread Safe (NTS) x86). I added it into the Additional/PleskPHP54/ext folder. I put extension=php_imagick.dll in the Additional/PleskPHP54/php.ini folder. I switched the website to PHP 5.4 FastCGI. I rebooted the server.

If I run cmd C:\...Additional\PleskPHP54\php-cgi.exe C:\websitefolder\phppinfo.php the script will generate the thumbnail using PHP 5.4. The imagick extension is listed in the array. But if I access the phppinfo.php via the website, it'll not show the extension and not generate the thumbnail.

Plesk Panel seems to exclude imagick.dll somehow for PHP 5.5 and 5.4 as FastCGI. Is there some override of the php.ini files?
 
I investigated further and I think I found a bug inside plesk. I have a second server, running Windows Server 2012 (not R2) and latest Plesk Panel 12.
I run some websites there with PHP 5.4. In Plesk Panel -> Website -> PHP settings, I got the following:
extension=php_fileinfo.dll
extension=php_bz2.dll


It works nicely. If I switch these websites to use PHP 5.5 now and add the extensions to the PHP settings for 5.5, the extensions will not be loaded. The extensions are shipped with PHP by Plesk and the files are present in both, Parallels\Plesk\Additional\PleskPHP55\ext and Parallels\Plesk\Additional\PleskPHP54\ext by default Plesk installation. (Server rebooted of course)

So it seems to me that Plesk Panel does not include any extensions if PHP 5.5 is being used and the extensions are enabled in the Plesk Panel. What I do still not understand is, that the extensions mentioned here, bz2 and fileinfo, are included if I use PHP 5.4 but the imagick extension is not being loaded with PHP 5.4.

Support please!
 
I can assume that permissions for imagemagick dlls may be wrong. Perhaps you have unpacked archive somewhere and then moved dlls to php directory and psacln doesn't have access to these files now.
Also where you placed additional dlls like CORE_RL_magick_.dll and so on? Actually they should be placed in \Additional\PleskPHP55 and php_imagick.dll should be in ext.
 
You have been on the right trace - my Plesk www user did not have read/execute rights for the ImageMagick software folder. When giving permission here, everything works.
I just wonder a) why it does not give me a proper error message and b) why it does still not load extension if I set it in the website PHP settings but only if I use the php.ini directly.
 
Back
Top