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

Adding php-imagick #31

Open
fazalfarhan01 opened this issue Apr 22, 2021 · 6 comments
Open

Adding php-imagick #31

fazalfarhan01 opened this issue Apr 22, 2021 · 6 comments

Comments

@fazalfarhan01
Copy link

Request to add PHP module ImageMagick

@leonstafford
Copy link
Contributor

Thanks for suggesting, @fazalfarhan01, happy to add!

As it will still be a little time until I get to this, if you'd like to do some testing of how to do it, you can SSH into your Lokl website, via the option in the CLI wizard.

The environment is Alpine Linux, so package management is done via the apk command, if I recall correctly.

So, something like this may work: apk add imagemagick. There may be some other dependencies that it requires to be installed in a similar way. I haven't used any image stuff in PHP for a long time, so unsure if it will need extra work, like enabling an extension in an .ini file somewhere.

No need to try this if you don't want to, these will serve as notes for me when I am able to focus attention on it :D

@leonstafford
Copy link
Contributor

Hi @fazalfarhan01,

Sorry for late reply.

So, I've done some playing around and am now seeing ImageMagick installed OK in the PHP 7 version I'm testing in:

/usr/html # php -i | grep imag
/etc/php7/conf.d/imagick.ini
imagick
imagick module => enabled
imagick module version => 3.4.4
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version => ImageMagick 7.0.11-3 Q16 aarch64 2021-03-06 https://imagemagick.org
Imagick using ImageMagick library version => ImageMagick 7.0.11-9 Q16 aarch64 2021-04-24 https://imagemagick.org
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
imagick.skip_version_check => 0 => 0

Noting some of my steps to get it working from within running container:

git clone https://github.com/Imagick/imagick
cd imagick
apk add php7-dev gcc g++ imagemagic-dev
phpize && ./configure
make
make install
cd ../
rm -rf imagick
apk add php7-imagick

some of those steps likely redundant, can test further. I'll put this on hold for a while, as I'd like parity between the php 7 and 8 versions if possible, but give that a try within your php 7 container if you can and let me know if that allows you to use it from your WP app

@fazalfarhan01
Copy link
Author

Sure thing. I'll give it a try and reach back.

@leonstafford
Copy link
Contributor

should have been imagemagick-dev in above example, with the k

leonstafford added a commit that referenced this issue Oct 2, 2021
leonstafford added a commit that referenced this issue Oct 2, 2021
@leonstafford
Copy link
Contributor

WIP with last commits. PHP8 process diverged from 7 for this, using pecl, needing to symlink some php8- commands.

May be able to now use pecl for both php7 and 8 and save some steps for Image Magick, at least

leonstafford added a commit that referenced this issue Oct 3, 2021
@leonstafford
Copy link
Contributor

looks good in latest branches. Will be in next release

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

2 participants