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

Install error "Unterminated preprocessor conditions" in php 8.3 #640

Open
FedericoHeichou opened this issue Nov 24, 2023 · 16 comments
Open

Comments

@FedericoHeichou
Copy link

The first if condition in Imagick.stub.php is not closed

class Imagick
{
#if MagickLibVersion > 0x628
public function optimizeImageLayers(): bool {}

This causes a installation error "Unterminated preprocessor conditions" in PHP 8.3

I'll submit a PR

@dinamic
Copy link

dinamic commented Jan 15, 2024

Just had the same issue happening. Here are steps to reproduce:

docker run -it --rm php:8.3-alpine sh
apk update
apk add imagemagick imagemagick-dev gcc make autoconf g++ 
pecl install imagick

@UtkuDalmaz
Copy link

Any solution?

@dinamic
Copy link

dinamic commented Feb 5, 2024

@UtkuDalmaz People have tried to get in touch with the maintainer over different communication channels to no avail. I'm sticking with PHP 8.2 for now. Have a look at the discussion here: #641

@Danack
Copy link
Collaborator

Danack commented Feb 8, 2024

Thanks. It should be fixed now in develop, but as it never seemed to be a problem on my machine, I can't guarantee that.

I've actually just removed the #if MagickLibVersion > 0x628 as the minimum version of ImageMagick is above that now.

I'll close this issue when I'm more confident it's fixed (aka github actions are passing), but that will require more poking and possibly dropping support for PHP < 7.0 as the gen_stubs.php tool seems to no longer support those. Probably appropriately.

@dinamic
Copy link

dinamic commented Feb 8, 2024

@Danack so happy to hear from you! I hope things are okay.

The issue is easily reproducible with a docker container:

docker run -it --rm php:8.3-alpine sh
apk update
apk add imagemagick imagemagick-dev gcc make autoconf g++ 
pecl install imagick

@tcubukcu
Copy link

@UtkuDalmaz People have tried to get in touch with the maintainer over different communication channels to no avail. I'm sticking with PHP 8.2 for now. Have a look at the discussion here: #641

Yes using php8.2 seems like the best solution for now. I tried it on version 8.2, there was no problem with the installation.

@ihabzee
Copy link

ihabzee commented Mar 7, 2024

any update on when this issue will be fixed?
Thanks!

@mashb1t
Copy link

mashb1t commented Mar 8, 2024

having the same issue in PHP 8.3 (running on M1/arm and Docker)

admdly added a commit to admdly/FOSSBilling that referenced this issue Mar 13, 2024
Remove `imagick` dependency from Docker image as not strictly required (dompdf/dompdf#3376) and to resolve issue with PHP 8.3 (Imagick/imagick#640).
BelleNottelling pushed a commit to FOSSBilling/FOSSBilling that referenced this issue Mar 13, 2024
* Remove Docker image imagick dependency

Remove `imagick` dependency from Docker image as not strictly required (dompdf/dompdf#3376) and to resolve issue with PHP 8.3 (Imagick/imagick#640).

* Update Docker image to PHP 8.3

* Move GD to required PHP extensions
@ricardomecca
Copy link

Not have updates?
I've been waiting for the PECL update with the correction for more than 3 months but so far nothing.

@pF-luis
Copy link

pF-luis commented Apr 3, 2024

Same issue here

@mathroc
Copy link

mathroc commented Apr 3, 2024

A small recap: the issue is fixed on develop but a new tag for this hasn't been published yet. The maintainers are aware of this. Meanwhile, it means your choices are:

  • use develop instead of a tagged version
  • keep using PHP 8.2
  • fork the extension and tag a release of your own

You can also subscribe to this issue notifications, someone will very likely announce it here when a new tag appears.

But it's not very useful to post comment to "+1" the issue, complain or ask for estimates on when this will happen

@pF-luis
Copy link

pF-luis commented Apr 3, 2024

It's a simple comment, no harm done 😘 Thanks for the recap tho, thought something might've happened since the last official info was about two month ago.

@yesidevelop
Copy link

Sometimes it works, sometimes it doesn't strange bug
I tried this way
RUN pecl install imagick
RUN docker-php-ext-enable imagick

kpine added a commit to kpine/docker-webtrees that referenced this issue Apr 12, 2024
Imagick Fails when using `--no-cache --ci`: Imagick/imagick#640
@renky
Copy link

renky commented Apr 25, 2024

For everybody who is using mlocati/php-extension-installer

RUN install-php-extensions imagick/imagick@master

nevertheless: it's only a workarround in my opinion.
It's now more than two months ago that I had a last look on this issue and in all projects where I used imagick I finally could switch to gd or gmagick without any problems when upgrading to PHP8.3... Until today - now I have a project where I have to stick with imagick and I just see: still the same issue...

I know - the solution above works. But sorry... for productive environments I don't see an untagged version as a stable solution - in a production environment I need deterministic build processes and installation behavior and for that it is indispensable to have a tagged version of all dependencies... Just for a shortime workaround, I would accept such a develop solution.

If this extension cannot ensure this any more, I guess it's really EOL because more and more people will switch. That's why I again suggest to share responsibility for such an important php extension. It's also an option to contact the php foundation to request about helping in maintaining. Maybe the interest is high enough in case of this extension.

On the other side: Where is the problem to just put a tag on it?

Thanks to everybody who is working on it.

@eminozlem
Copy link

bumping for visibility. I am waiting for imagick to upgrade my websites to php 8.3. Hope this gets resolved soon 🙏

WHM OS
AlmaLinux v8.9.0

@tommmoe
Copy link

tommmoe commented May 16, 2024

bumping because I don't know how to follow, stuck on 8.2

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

Successfully merging a pull request may close this issue.