SoftCreatR / imei

IMEI - ImageMagick Easy Install
ISC License
309 stars 36 forks source link

Error php: symbol lookup error #80

Closed nightdread closed 1 year ago

nightdread commented 1 year ago

php -r 'phpinfo();' | grep HEIC php: symbol lookup error: /usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders/heic.so: undefined symbol: heif_init

SoftCreatR commented 1 year ago

Please provide the imei.log of your last installation.

nightdread commented 1 year ago

imei.log

SoftCreatR commented 1 year ago

Did you install php-imagick using apt? Because that won't work. Instead:

git clone https://github.com/Imagick/imagick.git
cd imagick
phpize
./configure
make
make install

Finally, add extension=imagick to your php.ini (and restart PHP, if needed) and you are done.

root@IM-Ampere:~/imagick# php -r 'phpinfo();' | grep HEIC
ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BAYER, BAYERA, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, JXL, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YAML, YCbCr, YCbCrA, YUV
nightdread commented 1 year ago

I install imagick by PECL

SoftCreatR commented 1 year ago

I didn't test it using PECL, but the manual installation as described above works as expected. At least, after 3cdb9a73efbaac6f51c888ac473ab4c0d20c4069

maxxer commented 1 year ago

I'm having the same error when I try to run the installation a second time.

I'm compiling and installing via Ansible, when I deploy the VM for the first time and run the playbook it works, PHP is installed with Imagick and HEIC support. If I happen to run it twice, then I get the reported error. And I cannot figure out what's wrong...

# ldd /usr/lib/php/20180731/imagick.so
    linux-vdso.so.1 (0x0000ffffbf0e2000)
    libgomp.so.1 => /lib/aarch64-linux-gnu/libgomp.so.1 (0x0000ffffbefb0000)
    libMagickWand-7.Q16HDRI.so.10 => /usr/local/lib/libMagickWand-7.Q16HDRI.so.10 (0x0000ffffbee70000)
    libMagickCore-7.Q16HDRI.so.10 => /usr/local/lib/libMagickCore-7.Q16HDRI.so.10 (0x0000ffffbeb50000)
    libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffffbe9a0000)
    /lib/ld-linux-aarch64.so.1 (0x0000ffffbf0a9000)
    libX11.so.6 => /lib/aarch64-linux-gnu/libX11.so.6 (0x0000ffffbe850000)
    libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffffbe7b0000)
    libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffffbe780000)
    liblcms2.so.2 => /lib/aarch64-linux-gnu/liblcms2.so.2 (0x0000ffffbe710000)
    libraqm.so.0 => /lib/aarch64-linux-gnu/libraqm.so.0 (0x0000ffffbe6f0000)
    liblqr-1.so.0 => /lib/aarch64-linux-gnu/liblqr-1.so.0 (0x0000ffffbe6d0000)
    libfftw3.so.3 => /lib/aarch64-linux-gnu/libfftw3.so.3 (0x0000ffffbe600000)
    libxml2.so.2 => /lib/aarch64-linux-gnu/libxml2.so.2 (0x0000ffffbe410000)
    libfontconfig.so.1 => /lib/aarch64-linux-gnu/libfontconfig.so.1 (0x0000ffffbe3b0000)
    libfreetype.so.6 => /lib/aarch64-linux-gnu/libfreetype.so.6 (0x0000ffffbe2e0000)
    libXext.so.6 => /lib/aarch64-linux-gnu/libXext.so.6 (0x0000ffffbe2b0000)
    libbz2.so.1.0 => /lib/aarch64-linux-gnu/libbz2.so.1.0 (0x0000ffffbe280000)
    libz.so.1 => /lib/aarch64-linux-gnu/libz.so.1 (0x0000ffffbe250000)
    libltdl.so.7 => /lib/aarch64-linux-gnu/libltdl.so.7 (0x0000ffffbe230000)
    libxcb.so.1 => /lib/aarch64-linux-gnu/libxcb.so.1 (0x0000ffffbe1f0000)
    libharfbuzz.so.0 => /lib/aarch64-linux-gnu/libharfbuzz.so.0 (0x0000ffffbe110000)
    libfribidi.so.0 => /lib/aarch64-linux-gnu/libfribidi.so.0 (0x0000ffffbe0e0000)
    libglib-2.0.so.0 => /lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000ffffbdf90000)
    libicuuc.so.70 => /lib/aarch64-linux-gnu/libicuuc.so.70 (0x0000ffffbdd80000)
    liblzma.so.5 => /lib/aarch64-linux-gnu/liblzma.so.5 (0x0000ffffbdd40000)
    libexpat.so.1 => /lib/aarch64-linux-gnu/libexpat.so.1 (0x0000ffffbdd00000)
    libuuid.so.1 => /lib/aarch64-linux-gnu/libuuid.so.1 (0x0000ffffbdce0000)
    libpng16.so.16 => /lib/aarch64-linux-gnu/libpng16.so.16 (0x0000ffffbdc90000)
    libbrotlidec.so.1 => /lib/aarch64-linux-gnu/libbrotlidec.so.1 (0x0000ffffbdc70000)
    libXau.so.6 => /lib/aarch64-linux-gnu/libXau.so.6 (0x0000ffffbdc50000)
    libXdmcp.so.6 => /lib/aarch64-linux-gnu/libXdmcp.so.6 (0x0000ffffbdc30000)
    libgraphite2.so.3 => /lib/aarch64-linux-gnu/libgraphite2.so.3 (0x0000ffffbdc00000)
    libpcre.so.3 => /lib/aarch64-linux-gnu/libpcre.so.3 (0x0000ffffbdb80000)
    libicudata.so.70 => /lib/aarch64-linux-gnu/libicudata.so.70 (0x0000ffffbbf50000)
    libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000ffffbbd20000)
    libbrotlicommon.so.1 => /lib/aarch64-linux-gnu/libbrotlicommon.so.1 (0x0000ffffbbce0000)
    libbsd.so.0 => /lib/aarch64-linux-gnu/libbsd.so.0 (0x0000ffffbbcb0000)
    libmd.so.0 => /lib/aarch64-linux-gnu/libmd.so.0 (0x0000ffffbbc90000)
maxxer commented 1 year ago

NVM... I tried several times again and it always worked fine. 🤷🏼‍♂️

WillSARCats commented 10 months ago

would this workd for lsphp too? Kind of a pain figuring out how to get this AVIF plugin to work. It requries imagick version 7, but 3.7.0 currently only compiles from Image Magick 6.9

https://www.cachecrawler.com/WP-Plugins/WP-Plugin-avif-webp-Replacement-for-LiteSpeed-LScache::6574.html

From emailing the developer, he replied with this: Imagick is not part of LSWS. Regarding ImageMagick, this is the PHP related. Imagick is OS related, although there are differences. As long as you optimize and convert images with PHP, only ImageMagick is relevant to you, which also applies to the AWR plugin, since the AWR plugin uses ImageMagick. This means that you only need ImageMagick version 7 and above for the AWR plugin, but you do not need Imagick. The AWR plugin checks whether ImageMagick version 7 or higher is available. Otherwise you wouldn't be able to access the AWR plugin at all. That's why I think you're trying to solve a problem that I don't think exists when it comes to the AWR plugin. With PHP 8.1 or higher you already have everything you need for the AWR plugin.

SoftCreatR commented 10 months ago

would this workd for lsphp too? Kind of a pain figuring out how to get this AVIF plugin to work. It requries imagick version 7, but 3.7.0 currently only compiles from Image Magick 6.9

https://www.cachecrawler.com/WP-Plugins/WP-Plugin-avif-webp-Replacement-for-LiteSpeed-LScache::6574.html

From emailing the developer, he replied with this: Imagick is not part of LSWS. Regarding ImageMagick, this is the PHP related. Imagick is OS related, although there are differences. As long as you optimize and convert images with PHP, only ImageMagick is relevant to you, which also applies to the AWR plugin, since the AWR plugin uses ImageMagick. This means that you only need ImageMagick version 7 and above for the AWR plugin, but you do not need Imagick. The AWR plugin checks whether ImageMagick version 7 or higher is available. Otherwise you wouldn't be able to access the AWR plugin at all. That's why I think you're trying to solve a problem that I don't think exists when it comes to the AWR plugin. With PHP 8.1 or higher you already have everything you need for the AWR plugin.

See https://github.com/SoftCreatR/imei?tab=readme-ov-file#php-imagick-extension

WillSARCats commented 10 months ago

I still get this in the phpini for wordpress in litespeed server:

Imagick compiled with ImageMagick version | ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org

If I try removing ImageMagic 6 before installing 7 as well, the server kind of breaks.

SoftCreatR commented 10 months ago

If I try removing ImageMagic 6 before installing 7 as well, the server kind of breaks.

What does that mean?

WillSARCats commented 10 months ago

Over on this website is a guide similiar to this githubs, which includes removing 6 first? I tried both doing that (breaks server) and not doing that and just this github's install method with your 'see' - which still lists ImageMagick 6.9 in phpinfo in the wordpress root

https://doc.owncloud.com/server/next/admin_manual/installation/manual_installation/manual_imagick7.html

SoftCreatR commented 10 months ago

breaks server

I still don't know, what that means exactly.

WillSARCats commented 10 months ago

the Kitt AWR plugin would stop working in wordpress.

Kind regards,

William Skea On 31/01/2024 1:40:43 PM, Sascha Greuel @.> wrote: breaks server I still don't know, what that means exactly. — Reply to this email directly, view it on GitHub [https://github.com/SoftCreatR/imei/issues/80#issuecomment-1918266393], or unsubscribe [https://github.com/notifications/unsubscribe-auth/BDO3M5NX2D7N6HUA6DNJW23YRGVKXAVCNFSM6AAAAAAYRWK6ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJYGI3DMMZZGM]. You are receiving this because you commented.Message ID: @.>

SoftCreatR commented 10 months ago

https://www.reddit.com/r/Litespeed/comments/1adk6yz/how_to_compile_and_install_latest_imagik_version/

That was you, I guess? Maybe, you can define the ImageMagick path when compiling the imagick module. But tbh, I don't know. Maybe you can ask there: https://github.com/Imagick/imagick

the Kitt AWR plugin would stop working in Wordpress.

I don't think so.

WillSARCats commented 10 months ago

yeah that's me too. I'm not sure how to do that properly.

I thought maybe this but it didn't do it.

git clone https://github.com/Imagick/imagick.git /usr/local/lsws/lsphp81/bin/phpize ./configure --with-imagick=/usr/local/lsws/lsphp81 make make install touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt systemctl restart lsws

Kind regards,

William Skea On 31/01/2024 1:50:12 PM, Sascha Greuel @.> wrote: https://www.reddit.com/r/Litespeed/comments/1adk6yz/how_to_compile_and_install_latest_imagik_version/ [https://www.reddit.com/r/Litespeed/comments/1adk6yz/how_to_compile_and_install_latest_imagik_version/] That was you, I guess? Maybe, you can define the ImageMagick path when compiling the imagick module. But tbh, I don't know. Maybe you can ask there: https://github.com/Imagick/imagick [https://github.com/Imagick/imagick] — Reply to this email directly, view it on GitHub [https://github.com/SoftCreatR/imei/issues/80#issuecomment-1918275080], or unsubscribe [https://github.com/notifications/unsubscribe-auth/BDO3M5LJVPL2AM5OOG2VFZ3YRGWOJAVCNFSM6AAAAAAYRWK6ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJYGI3TKMBYGA]. You are receiving this because you commented.Message ID: @.>

SoftCreatR commented 10 months ago

https://github.com/SoftCreatR/imei/issues/80#issuecomment-1566265225

WillSARCats commented 10 months ago

thats what I tried first

SoftCreatR commented 10 months ago

https://github.com/Imagick/imagick.git

That's how to compile Imagick manually. But as I said: If you don't remove IM 6 first, you have to find a way to tell imagick to use a different library location. But I don't know, if that works. So I'd recommend you to ask here.

If that doesn't work, there's no other way than uninstalling IM 6 first.

costinr1 commented 4 months ago

Did you install php-imagick using apt? Because that won't work. Instead:

git clone https://github.com/Imagick/imagick.git
cd imagick
phpize
./configure
make
make install

Finally, add extension=imagick to your php.ini (and restart PHP, if needed) and you are done.

root@IM-Ampere:~/imagick# php -r 'phpinfo();' | grep HEIC
ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BAYER, BAYERA, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, JXL, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, STRIMG, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YAML, YCbCr, YCbCrA, YUV

Hi, I'm not able to obtain the HEIC extension in phpinfo, after following these steps. Imagemagick was installed with your script without issues, the result is:

root@cloud:/# identify -version Version: ImageMagick 7.1.1-34 Q16-HDRI x86_64 39a4f1cb2:20240623 https://imagemagick.org Copyright: (C) 1999 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC HDRI Modules OpenMP(4.5) Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc heic jbig jng jp2 jpeg jxl lcms lqr ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf x xml zip zlib zstd Compiler: gcc (9.4)

But after removing the previous php-imagick with the command:

apt remove "php*-imagick" --purge -y && apt autoremove --purge -y

and after step-by-step with your instructions above, made in /usr/lib, and after adding: extension=imagick or extension=/usr/lib/imagick or extension=/usr/lib/imagick/imagick and apache restart each time, I get no HEIC. In fact, I get no ImageMagick in phpinfo.

What am I doing wrong?

My system is:

System Linux cloud.XXXX.eu 5.4.0-187-generic #207-Ubuntu SMP Mon Jun 10 08:16:10 UTC 2024 x86_64 Build Date Jul 5 2024 12:03:23 Build System Linux Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php/8.3/apache2 Loaded Configuration File /etc/php/8.3/apache2/php.ini Scan this dir for additional .ini files /etc/php/8.3/apache2/conf.d

Thank you,

SoftCreatR commented 4 months ago

Did you also restart the PHP process?

costinr1 commented 4 months ago

Did you also restart the PHP process?

Thanks for answer, yes, at least I think so (apache restart, and also the whole system reboot).

costinr1 commented 4 months ago

I wanted to use this method to install imagemagick with heic for nextcloud, to have heic previews. Unfortunately, it seems I'm not able to find way to install a php8.3-imagick that works with this version of imagemagick.

SoftCreatR commented 4 months ago

What does php -v display in the console?

costinr1 commented 4 months ago

Here it is:

root@cloud:~# php -v
PHP 8.3.9 (cli) (built: Jul  5 2024 12:03:23) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.9, Copyright (c), by Zend Technologies
root@cloud:~# 
SoftCreatR commented 4 months ago

And the phpinfo in nextcloud?

boryn commented 4 months ago

Finally, I was able to install it as the php module. So, after installing the core ImageMagick library, instead of doing git clone https://github.com/Imagick/imagick.git, phpize, etc. I've used pecl install imagick. So, here is my list of working commands for Ubuntu (set your php ini dir):

apt-get install -y php-pear php8.3-dev

pecl config-set php_ini "$PHP_INI_DIR/php.ini"
pear config-set php_ini "$PHP_INI_DIR/php.ini"

t=$(mktemp) && \
wget 'https://dist.1-2.dev/imei.sh' -qO "$t" && \
bash "$t" && \
printf "\n" | pecl install imagick \
rm "$t"

The pecl install imagick did proper autodetection and now I have ImageMagick 7.x in PHP (including HEIC):

image