Local Community

ImageMagick on PHP 8

PHP 8 now supports ImageMagick. Is there a way for me to update my PHP 8 installation so that it includes it?

Or will the ImageMagick compatible version of PHP 8 come baked into Local soon?

Hey @ddegner – Welcome to the Local Community Forums, and thanks for bringing this up!

Local doesn’t have an easy way to update the PHP service, but we do have some work lined up to improve our Lightning Services (the various server processes like PHP,MySQL,Nginx/Apache) and I’ve made a note to include adding Imagick with the PHP 8 work.

I don’t have an exact ETA for when this will be release, but in order to streamline communication, I’ve moved this topic to our “Feature Requests” category so that it can be up-voted to help determine the priority for getting this done!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Issue Summary

Absence of Imagick causing plugin issues.

Troubleshooting Questions

As everyone is aware by now, Imagick is still NOT included in php 8.x for Local. I have come across a few major plugins, the most prominent being Imagify which no longer work on a local site due to the missing library.

Downgrading to PHP 7.x or below is not an option, and other posts on this forum are either outdated or do not provide a working answer. I’ve tried adding the Imagick dll manually, but to no avail.

Developers, please tell me if there is a reliable way to install/enable imagick for PHP 8.x

With newly installed Local 6.5.2 on Mac OS Catalina I have missing ImageMagick PHP module error in 7.* version line as well (7.3.5, 7.4.30).
It breaks some WordPress plugins and is a regression.

I’m on Linux Mint 21.1, using Local 6.6.0. Installed sites report no imagic module present. I installed imagemagic and php imagic systemwide and tried to add path to the module in php.ini.hbs file but no joy here unfortunately. Is there a way to add systemwide imageic module?

Seconding this. Given it was working in the PHP 7.4 installation it’s effectively a regression.

We’re targetting PHP 8.0 now because obviously WP-Engine (and everybody else) is going to be forcing us there soon and not being able to test or run code that requires imagick under PHP 8.0 is proving to be a brick wall for us.

If it’s not seen as a priority to add this back in officially, we’d be very grateful if someone could semi-officially document the steps required for us to add this back into the PHP 8.0 build ourselves… even if that meant our installation was (for now) unsupported.

Thanks!

Bug Summary

The currently bundled PHP libraries have dropped the imagick module

Steps to reproduce

Either:

  • in WordPress check the WP core Tools->SiteHealth & note the complaint from WP about the missing module (https://i.imgur.com/J7OJMRQ.png)
    or
  • attempt to run a theme or plugin that performs image manipulation and note the error
    or
  • select “PHP version” in Local as 8.0.22 or 8.1.9, click apply, then click details. Note that “imagick” is not found in the generated phpinfo page

Environment Info

  • Debian 11
  • nginx, PHP 8.0.22/8.1.9, MySQL 8.0.16
  • Local 6.7.0+6347

Supporting info

Following on from a support comment on another recent thread:

Agreed, our goal is that all of those PHP versions should be compiled with the same default set of extensions. We’ll make sure PDO support is added on all versions going forward!

And (I know I’m repeating myself but…) make sure that list of extensions includes imagick given that WP core now checks for that & complains if it’s not there and plenty of plugins and themes require that functionality.

It’s currently not included in the bundled builds of PHP 8.0.22 or 8.1.9

I know that this has been brought up several times but it feels like it’s getting brushed aside a little. It would be great if we could get an acknowledgement of this & know if there are plans around correcting it because at the moment we’re migrating sites out of Local into other solutions in order to support clients that use this and need to be on PHP 8 - a “yes we know and it’ll be in the builds for the next point release” or “it might make it into the next major release” or “we’ll add it to the todo list for future consideration” and a timeline would help us know how much effort we should be putting into this migration.

Don’t get me wrong - I am VERY grateful for how much Local has streamlined our WP development (in fact setting up alternative development environments is reminding me just how much it’s helped!) but a little feedback on the status here would go a long way. Our live sites on WP Engine all have it included - if you’re wanting to mimic the live site experience then it’s an odd thing to remove (and yes we have considered using a WP Engine environment directly for development… but it’s hardly ideal lol)

Thanks!

Jon

1 Like

While waiting I installed ImageMagick myself on macOS php 8.1.18 and linked to Local php 8.1.9. It’s working now, so maybe it will help someone. I had homebrew and php 8.1 installed already.

Local terminal:

brew install pkg-config imagemagick
pecl install imagick

You should see something similar to 'Installing ‘/usr/local/Cellar/php@8.1/8.1.18/pecl/20210902/imagick.so’. This is the path we need.
Local /conf/php/php.ini.hbs:
Comment lines:

; {{#if intelChipMac}}
; [imagick]
; extension = {{extensionsDir}}/imagick.so
; {{/if}}

Add lines:

[imagick]
extension="/usr/local/Cellar/php@8.1/8.1.18/pecl/20210902/imagick.so"

Restarted Local site and php info now shows ImageMagick number of supported formats: 256.

@hmmux I tried your steps, but still getting the same errors.

This fixed my issue.

If you are using zsh, comment these lines under .zshrc file

#export PATH="/opt/homebrew/opt/php@8.0/bin:$PATH"
#export PATH="/opt/homebrew/opt/php@8.0/sbin:$PATH"