How to use imagick with PHP 7.2?

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
TomXampp
Posts: 26
Joined: 2015-12-02T00:21:23-07:00
Authentication code: 1151

How to use imagick with PHP 7.2?

Post by TomXampp »

In PHP 7.2, the extensions definitions in the php.ini file do not require the initial "php_" nor the extension ".dll". So, for the php_imagick.dll file to be specified as an extension in the php.ini file, in theory you only need to add:

Code: Select all

extension=imagick
Not:

Code: Select all

extension=php_imagick.dll
...although, for backward compatibility, the instructions at the top of the file indicate that the older, full-name specification will still work but will be deprecated at some point.

Using either form above does not work. When using the new form (

Code: Select all

extension=imagick
) and when I start my XAMPP Apache server, I receive this error:
[23-Dec-2017 15:55:49 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: C:\xampp\php\ext\imagick (The specified module could not be found.
), C:\xampp\php\ext\php_imagick.dll (The specified procedure could not be found.
)) in Unknown on line 0
Using the older form of the extension initialization, (

Code: Select all

extension=php_imagick.dll
), the error message becomes:
[23-Dec-2017 15:55:49 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: C:\xampp\php\ext\php_imagick.dll (The specified module could not be found.
), C:\xampp\php\ext\php_php_imagick.dll.dll (The specified procedure could not be found.
)) in Unknown on line 0
I do have the file in the right location for XAMMP (C:\xampp\php\ext).

Can anyone else reproduce this error and/or provide a solution? I can't use PHP 7.2 until this is solved (imagick works in PHP 7.1).
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: How to use imagick with PHP 7.2?

Post by Bonzo »

Imagick is not written or maintained by the people who maintain Imagemagick.

I believe Imagick needs compiling with the correct version of Imagemagick and php; it also depend on what version of visual basic? it is compiled with. So you should try and find a dll for php 7.2. Sometimes you are lucky and the dll will work with a different version.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to use imagick with PHP 7.2?

Post by fmw42 »

Also be sure the use either IM 6 or 7, whichever is compatible with your version of Imagick and also be consistent with 32-bit or 64-bit versions all around as per your OS.
Post Reply