Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagemagick version mismatch #93

Closed
shivammathur opened this issue Nov 11, 2021 · 7 comments · Fixed by #95
Closed

imagemagick version mismatch #93

shivammathur opened this issue Nov 11, 2021 · 7 comments · Fixed by #95

Comments

@shivammathur
Copy link
Contributor

For PHP 7.4 and lower after the release of imagick 3.6.0RC1, ImageMagick was updated, so it gives the version mismatch warning

PHP Warning:  Version warning: Imagick was compiled against ImageMagick version 1799 but version 1808 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0

While this is a warning, it breaks PhpManager installing any extensions specified after imagick.
Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/1447619348/workflow

This can be fixed temporarily by changing the $pageUrl in Install-ImagickPrerequisite.ps1 to archives, but when imagick 3.6.0 releases it would break again as the change will have to be reverted, as that will use newer ImageMagick.

Also, I noticed now the ImageMagick DLLs are inside the extension zip for versions lower than PHP 8.0, so maybe using those instead of downloading the library might help.

@mlocati
Copy link
Owner

mlocati commented Nov 11, 2021

I checked the ImageMagick versions used to build the different imagick versions:

Imagick \ PHP 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
3.1.2 6.8.8-4 Q16 6.8.8-4 Q16 6.8.8-4 Q16 6.8.8-4 Q16 x x x x x x
3.3.0 6.8.9-1 Q16 6.8.9-1 Q16 6.9.1-2 Q16 6.9.1-2 Q16 x x x x x x
3.4.0 x 6.8.9-1 Q16 6.9.1-2 Q16 6.9.1-2 Q16 6.9.2-0 Q16 x x x x x
3.4.1 x 6.8.9-1 Q16 6.9.3-7 Q16 6.9.3-7 Q16 6.9.3-7 Q16 x x x x x
3.4.2 x 6.8.9-1 Q16 6.9.3-7 Q16 6.9.3-7 Q16 6.9.3-7 Q16 x x x x x
3.4.3 x x 6.9.3-7 Q16 6.9.3-7 Q16 6.9.3-7 Q16 6.9.3-7 Q16 x x x x
3.4.4 x x x x x 6.9.3-7 Q16 7.0.7-11 Q16 7.0.7-11 Q16 7.0.7-11 Q16 x
3.5.0 x x x x x x x 7.0.7-11 Q16 7.0.7-11 Q16 7.0.7-11 Q16
3.5.1 x x x x x x x 7.0.7-11 Q16 7.0.7-11 Q16 7.0.7-11 Q16
3.6.0rc1 x x x x x x x 7.1.0-13 Q16 7.1.0-13 Q16 7.1.0-13 Q16

So, in order to install the correct ImageMagick version, we need to know the version of PHP and the version of imagick.

At the moment, Install-PhpExtensionPrerequisite (and Install-ImagickPrerequisite) is only aware of the PHP version, so this is a problem.

We have 2 options:

  1. get rid of the Install-ImagickPrerequisite function
    I noticed that the php_imagick-....zip files available at https://windows.php.net/downloads/pecl now come with the required ImageMagick DLLs (IIRC it was not so a few years ago), so we don't have to download another file with the ImageMagick dependencies
  2. add a new (required) argument to Install-PhpExtensionPrerequisite and Install-ImagickPrerequisite with the imagick version
    In order to know it we'd need to call Get-PhpExtension:
    $extensionVersion = (Get-PhpExtension -Path Path\To\php_imagick.dll).Version

@shivammathur
Copy link
Contributor Author

shivammathur commented Nov 11, 2021

There will be a change required in setup-php in both cases, so option 1 seems better, but whatever is easier for you.

@mlocati
Copy link
Owner

mlocati commented Nov 11, 2021

so option 1 seems better

Here it is: #95.

I'm going to publish a new release with this fix as soon as your code is ready.

@mlocati
Copy link
Owner

mlocati commented Nov 11, 2021

@shivammathur just drop me a note when you are ready

@shivammathur
Copy link
Contributor Author

@mlocati Please go ahead with the release.

@mlocati
Copy link
Owner

mlocati commented Nov 11, 2021

@shivammathur Done

@shivammathur
Copy link
Contributor Author

Awesome! Thanks for fixing this quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants