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

Composer does not see PHP's imagick extension #2398

Open
Leksat opened this issue Oct 31, 2024 · 2 comments
Open

Composer does not see PHP's imagick extension #2398

Leksat opened this issue Oct 31, 2024 · 2 comments
Labels
bug Something isn't working triage Issue needs triage

Comments

@Leksat
Copy link

Leksat commented Oct 31, 2024

What happened?

composer install fails if one of the dependencies requires ext-imagick, e.g.

... requires ext-imagick * -> it is missing from your system. Install or enable PHP's imagick extension.

Even though php82Extensions.imagick is installed.

I've seen #356 from 2022, but it is marked as fixed.

Steps to reproduce

$ devbox run "php -r 'var_dump(extension_loaded(\"imagick\"));'"
bool(true)

$ devbox run "composer exec -- php -r 'var_dump(extension_loaded(\"imagick\"));'"
bool(false)

The above requires a minimal composer.json file:

{
    "name": "test/test",
    "version": "0.0.0"
}

Command

run

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
  "packages": [
    "[email protected]",
    "php82Packages.composer@2",
    "php82Extensions.imagick@latest"
  ]
}

Devbox version

0.13.6

Nix version

No response

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

No response

@Leksat Leksat added bug Something isn't working triage Issue needs triage labels Oct 31, 2024
@Leksat
Copy link
Author

Leksat commented Oct 31, 2024

Is it a bug in Devbox? Or am I missing some config?

@Leksat
Copy link
Author

Leksat commented Oct 31, 2024

Found this comment: #2213 (comment)

Our Php plugin already installs composer alongside PHP, so you do not need to install your own copy.

I tried to remove php82Packages.composer and my issue got resolved 🎉

Though, there are still some open question.

1/ Currently Composer v2 is the standard. But for the future, how to control Composer's version?

2/ Should Composer package be removed on the docs page? https://www.jetify.com/docs/devbox/devbox_examples/languages/php/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

1 participant