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

[Package Request] - Include php-pecl-imagick #466

Closed
micrology opened this issue Sep 23, 2023 · 6 comments
Closed

[Package Request] - Include php-pecl-imagick #466

micrology opened this issue Sep 23, 2023 · 6 comments

Comments

@micrology
Copy link

What package is missing from Amazon Linux 2023? Please describe and include package name.
php-pecl-imagick
It provides a wrapper to the ImageMagick library
URL : https://pecl.php.net/package/imagick
Description : Imagick is a native php extension to create and modify images using the ImageMagick API.

Is this an update to existing package or new package request?
New request

Is this package available in Amazon Linux 2? If it is available via external sources such as EPEL, please specify.

Yes, and from the Fedora distribution

Any additional information you'd like to include. (use-cases, etc)

It provides a PHP module that is highly recommended for a WordPress installation, as well as providing a host of image manipulation facilities.

@limmike
Copy link

limmike commented Sep 24, 2023

I did pecl install in my CloudFormation EC2 userdata as follows, and is able to install WordPress.

dnf install -q -y php-devel php-pear gcc
pear update-channels
pecl update-channels

dnf install -q -y ImageMagick-devel ImageMagick
/usr/bin/yes 'no' | sudo pecl install -f --configureoptions 'with-imagick="autodetect"' imagick
echo 'extension=imagick.so' > /etc/php.d/25-imagick.ini

systemctl restart php-fpm

Edit: Seems that PECL install does not work with PHP 8.3, please refer to re:Post article How do I compile PHP extensions on Amazon Linux 2023?

Edit : run the above commands as root

@micrology
Copy link
Author

Thanks - that seems to work. Some caveats:

  • All commands need to be run by root (or with sudo)
  • I needed to add a file that I called /etc/php.d/20-imagick.ini containing the one line extension=imagick
  • After installation, run sudo systemctl restart php-fpm

@micrology
Copy link
Author

micrology commented Oct 7, 2023 via email

@danbrellis
Copy link

I see the issue is closed but was there a resolution on this? Can I add the packages to .ebextensions/install_dependancies.config? What are they called? Thanks!

@rwhirn
Copy link

rwhirn commented Oct 22, 2024

@limmike
Are these two lines not duplicates? The second just performing autoanswer to prompts?

pecl install --configureoptions 'with-imagick="autodetect"' imagick
/usr/bin/yes 'no' | sudo pecl install -f --configureoptions 'with-imagick="autodetect"' imagick

But thanks for the solution. Very helpful!

@limmike
Copy link

limmike commented Oct 23, 2024

@limmike Are these two lines not duplicates? The second just performing autoanswer to prompts?

pecl install --configureoptions 'with-imagick="autodetect"' imagick /usr/bin/yes 'no' | sudo pecl install -f --configureoptions 'with-imagick="autodetect"' imagick

But thanks for the solution. Very helpful!

@rwhirn good catch! updated

btw, PECL install for PHP 8.3 does not work for me. You can refer to my re:Post article How do I compile PHP extensions on Amazon Linux 2023? for Imagick and other extensions.

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

No branches or pull requests

4 participants