Skip to content

[PHP-wasm] Imagick extension #2383

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

Draft
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Draft

[PHP-wasm] Imagick extension #2383

wants to merge 5 commits into from

Conversation

bgrgicak
Copy link
Collaborator

@bgrgicak bgrgicak commented Jul 18, 2025

🚧 WIP

Motivation for the change, related issues

Playground currently doesn't support the Imagick PHP extension.

Implementation details

This PR creates a shared Imagick library, and loads the extension if withImagick is set to true in PHPLoaderOptions.

TODO

  • Correctly build and load Imagick. It's currently failing with
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) '/internal/shared/extensions/imagick.so' in Unknown on line 0
  • Add basic usage tests for Imagick
  • Review code (a lot of it is copy pasted from Xdebug and may not be needed)
  • Ensure Imagick supports different image types like png and jpeg

Testing Instructions for development

  • Build share library npx nx run php-wasm-compile:imagick:jspi:8.3
  • Run tests npx nx run php-wasm-node:test-jspi-imagick

@bgrgicak
Copy link
Collaborator Author

Here's a copy of our previous conversations about compiling Imagick, it looks mostly irrelevant, but I would at least like to preserve the history.

from @bgrgicak
I changed the base of the branch to add-xdebug-support-to-php-wasm-node because loading the imagick extension will require dynamic linking support.

When I run the imagick.spec.ts test it fails with:

Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/20230831/imagick (Could not load dynamic lib: /usr/local/lib/php/20230831/imagick
Error: ENOENT: no such file or directory, open '/usr/local/lib/php/20230831/imagick'), /usr/local/lib/php/20230831/imagick.so (Could not load dynamic lib: /usr/local/lib/php/20230831/imagick.so
Error: ENOENT: no such file or directory, open '/usr/local/lib/php/20230831/imagick.so')) in Unknown on line 0

stderr | src/test/imagick.spec.ts > imagick > generate image
Error in loading dynamic library /usr/local/lib/php/20230831/imagick: Error: ENOENT: no such file or directory, open '/usr/local/lib/php/20230831/imagick'
Error in loading dynamic library /usr/local/lib/php/20230831/imagick.so: Error: ENOENT: no such file or directory, open '/usr/local/lib/php/20230831/imagick.so'
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/local/lib/php/20230831/imagick (Could not load dynamic lib: /usr/local/lib/php/20230831/imagick
Error: ENOENT: no such file or directory, open '/usr/local/lib/php/20230831/imagick'), /usr/local/lib/php/20230831/imagick.so (Could not load dynamic lib: /usr/local/lib/php/20230831/imagick.so
Error: ENOENT: no such file or directory, open '/usr/local/lib/php/20230831/imagick.so')) in Unknown on line 0

As a next step, I need to better understand how dymanic linking in #60 works.

from @mho22
@brandonpayton has much more experience in this thanks to his work on #60 but I would be glad to help you with this too!

from @bgrgicak
Apparently I'm not compiling the .so file correctly even after I added EMCC_FLAGS=\"-sSIDE_MODULE -D__x86_64__ -sWASM_BIGINT=1\" and switched to emmake.

Next step, figure out how to compile the .so file so it's valid wasm file.

(Could not load dynamic lib: /extensions/imagick.so
Error: need to see wasm magic number),

from @mho22
Maybe by adding the emconfigure after phpize ? :

emconfigure ./configure --host=\"i386-unknown-freebsd\" --disable-static --enable-shared; \\

And maybe /root/emsdk/emsdk_env.sh && \ should be sourced before emconfigure ?

Oh ! Maybe imagick should be built in php/Dockerfile using phpize from the main module ?

from @bgrgicak
Thanks @mho22! These comments help a lot. 🙂

I started getting build issue now, so I have something to research.

Oh ! Maybe imagick should be built in php/Dockerfile using phpize from the main module ?

I'm curious if there's a difference between phpize that we build manually inside the php/Dockerfile from phpize that I install from apt.

from @adamziel
I'm curious if there's a difference between phpize that we build manually inside the php/Dockerfile from phpize that I install from apt.

I'd assume they target different php versions.

from @brandonpayton
@bgrgicak and I discussed the build a bit yesterday. phpize is provided with each PHP version, and I think it is probably safest for compatibility to use the phpize which comes with each PHP version. Bero brought up wanting to avoid the long wait involved with re-running PHP build before building his plugin, and we talked about the possibility of adding more Docker layers so maybe our dynamic libraries could be based on cached, version-specific images from the php-wasm/compile/php/Dockerfile. It would be amazing if we could iterate more quickly with these dynamic extension builds.

from @bgrgicak
I was able to build Imagick for PHP 8.3 and JSPI.

When I try to run the test it returns this error:

src/test/imagick.spec.ts > imagick > generate image
RuntimeError: Aborted(Assertion failed: undefined symbol 'MagickWandGenesis'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment)
❯ abort asyncify/php_8_3.js:684:11
682| // TODO(google/closure-compiler#3913): Remove if/when upstream closure gets fixed.
683| /** @Suppress {checkTypes} */
684| var e = new WebAssembly.RuntimeError(what);
| ^
685|
686| // Throw the error whether or not MODULARIZE is set because abort is used
❯ assert asyncify/php_8_3.js:309:4
❯ resolveSymbol asyncify/php_8_3.js:2117:5
❯ stubs. asyncify/php_8_3.js:2153:21
❯ null. wasm:/wasm/0010ca56:1:201003
❯ zend_startup_module_ex wasm:/wasm/php.wasm-06a9d26a:1:11754213
❯ zend_startup_module_zval wasm:/wasm/php.wasm-06a9d26a:1:11755706
❯ zend_hash_apply wasm:/wasm/php.wasm-06a9d26a:1:11839547
❯ zend_startup_modules wasm:/wasm/php.wasm-06a9d26a:1:11755279
❯ call wasm:/wasm/php.wasm-06a9d26a:1:13174833

from @bgrgicak
I built Image Magic without emmake, so the libMagick*.so files created an error during the Imagick build.
Now I've changed the build for Image Magic to use emmake, and I'm able to build with these so files.

But after changing the approach to building, I'm not getting an imagick.so file as the build result.

from @bgrgicak
I'm unable to build Image Magick from a separate Dockerfile because it doesn't produce static libraries, so I tried moving the code into the PHP Dockerfile, but this resulted in new errors about missing libraries like libx11.

I will continue tomorrow.

from @adamziel
If imagick has other dependencies, which I’m not saying it has, we’ll need to build them to wasm as well. Libx11 looks suspicious. I wonder if it’s a part of the imagick project or a separate dependency

from @bgrgicak
I disabled X support and marked a few functions as unavailable. Now I'm able to rebuild imagick and ImageMagick, but both produce static libraries instead of shared libraries.

I need to understand why Image Magick isn't able to produce a shared library.

from @bgrgicak
Image Magick requires libm.

#5 88.36 *** Warning: linker path does not have real file for library -lm.
#5 88.36 *** I have the capability to make that library automatically link in when
#5 88.36 *** you link to this library. But I can only do this if you have a
#5 88.36 *** shared version of the library, which you do not appear to have
#5 88.36 *** because I did check the linker path looking for a file starting
#5 88.36 *** with libm but no candidates were found. (...for file magic test)
#5 88.36 *** The inter-library dependencies that have been dropped here will be
#5 88.36 *** automatically added whenever a program is linked with this library
#5 88.36 *** or is declared to -dlopen it.

from @adamziel
This SO answer suggests it is linked by default UNLESS it is explicitly specified with -lm. Oh emscripten 🤷 stackoverflow.com/questions/24663915/how-can-i-link-libm-to-my-emscripten-port

from @bgrgicak
This SO answer suggests it is linked by default UNLESS it is explicitly specified with -lm. Oh emscripten 🤷 stackoverflow.com/questions/24663915/how-can-i-link-libm-to-my-emscripten-port

I could have shared more context.

From this line it looks like libm is available#6 34.45 checking for sqrt in -lm... yes.

This is the issue I need to address.

#6 93.45 *** Since this library must not contain undefined symbols,
#6 93.45 *** because either the platform does not support them or
#6 93.45 *** it was explicitly requested with -no-undefined,
#6 93.45 *** libtool will only create a static version of it.

from @bgrgicak
This comment from @brandonpayton on the XDebug PR makes me think that I should try manually removing -lm from the Makefile and see if that produces a shared library.

from @bgrgicak
After removing the -lm flag from the Makefile for Image Magick, I'm getting unknown argument: -retain-symbols-file

This Emscripte comment suggests that there's a link flag that I need to remove.

I will continue working on this tomorrow.

#6 106.6 wasm-ld: error: unknown argument: -retain-symbols-file
#6 106.6 wasm-ld: error: unknown file type: MagickWand/.libs/libMagickWand-7.Q16HDRI.exp
#6 106.6 emcc2: error: '/root/emsdk/upstream/bin/wasm-ld -o MagickWand/.libs/libMagickWand-7.Q16HDRI.so.10.0.2 MagickWand/.libs/libMagickWand_7_Q16HDRI_la-animate.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-compare.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-composite.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-conjure.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-deprecate.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-display.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-drawing-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-identify.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-import.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-cli.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-image.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-property.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-mogrify.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-montage.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-operation.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-pixel-iterator.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-pixel-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-script-token.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-stream.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wandcli.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wand-view.o MagickCore/.libs/libMagickCore-7.Q16HDRI.so -retain-symbols-file MagickWand/.libs/libMagickWand-7.Q16HDRI.exp -L/root/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --import-memory --export-if-defined=__wasm_call_ctors --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-if-defined=__wasm_apply_data_relocs --experimental-pic --unresolved-symbols=import-dynamic -shared --no-export-dynamic' failed (returned 1)
#6 106.6 make[1]: *** [Makefile:7322: MagickWand/libMagickWand-7.Q16HDRI.la] Error 1
#6 106.6 make[1]: Leaving directory '/root/ImageMagick-7.1.1-47'
#6 106.6 make: *** [Makefile:6267: all] Error 2
#6 106.6 emmake: error: 'make -j1' failed (returned 2)
#6 106.6 make: make install
#6 106.7 make  install-am
#6 106.7 make[1]: Entering directory '/root/ImageMagick-7.1.1-47'
#6 106.7   CCLD     MagickWand/libMagickWand-7.Q16HDRI.la
#6 106.8 emcc2: warning: ignoring unsupported linker flag: `-rpath` [-Wlinkflags]
#6 106.8 emcc2: warning: ignoring unsupported linker flag: `-rpath` [-Wlinkflags]
#6 106.8 emcc2: warning: ignoring unsupported linker flag: `-soname` [-Wlinkflags]
#6 106.8 wasm-ld: error: unknown argument: -retain-symbols-file
#6 106.9 wasm-ld: error: unknown file type: MagickWand/.libs/libMagickWand-7.Q16HDRI.exp
#6 106.9 emcc2: error: '/root/emsdk/upstream/bin/wasm-ld -o MagickWand/.libs/libMagickWand-7.Q16HDRI.so.10.0.2 MagickWand/.libs/libMagickWand_7_Q16HDRI_la-animate.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-compare.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-composite.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-conjure.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-deprecate.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-display.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-drawing-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-identify.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-import.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-cli.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-image.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-property.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-mogrify.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-montage.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-operation.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-pixel-iterator.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-pixel-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-script-token.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-stream.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wand.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wandcli.o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wand-view.o MagickCore/.libs/libMagickCore-7.Q16HDRI.so -retain-symbols-file MagickWand/.libs/libMagickWand-7.Q16HDRI.exp -L/root/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --import-memory --export-if-defined=__wasm_call_ctors --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-if-defined=__wasm_apply_data_relocs --experimental-pic --unresolved-symbols=import-dynamic -shared --no-export-dynamic' failed (returned 1)
#6 106.9 make[1]: Leaving directory '/root/ImageMagick-7.1.1-47'
#6 106.9 make[1]: *** [Makefile:7322: MagickWand/libMagickWand-7.Q16HDRI.la] Error 1
#6 106.9 make: *** [Makefile:12831: install] Error 2
#6 106.9 emmake: error: 'make install' failed (returned 2)

from @bgrgicak
There's a wasm-imagemagick NPM package, but unfortunately, they build a static library.

from @bgrgicak
@mho22 @brandonpayton do you have any suggestions on how to find the root cause of this error](#147 (comment))?

from @bgrgicak
I run this using docker build -f packages/php-wasm/compile/image-magick/Dockerfile -t playground-php-wasm:imagick packages/php-wasm/compile/image-magick --progress=plain --build-arg WITH_JSPI=yes --build-arg WITH_DEBUG=yes --no-cache &> ./packages/php-wasm/compile/image-magick/output.log to generate the output.log.

from @bgrgicak
Here's the linker command that fails.

/root/emsdk/upstream/bin/wasm-ld
	-o
		MagickWand/.libs/libMagickWand-7.Q16HDRI.so.10.0.2
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-animate.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-compare.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-composite.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-conjure.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-deprecate.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-display.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-drawing-wand.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-identify.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-import.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-cli.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-image.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-property.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-magick-wand.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-mogrify.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-montage.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-operation.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-pixel-iterator.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-pixel-wand.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-script-token.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-stream.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wand.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wandcli.o
		MagickWand/.libs/libMagickWand_7_Q16HDRI_la-wand-view.o
		MagickCore/.libs/libMagickCore-7.Q16HDRI.so
	-retain-symbols-file
		MagickWand/.libs/libMagickWand-7.Q16HDRI.exp
	-L/root/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/pic
	-mllvm
	-combiner-global-alias-analysis=false
	-mllvm
	-enable-emscripten-sjlj
	-mllvm
	-disable-lsr
	--import-undefined
	--import-memory
	--export-if-defined=__wasm_call_ctors
	--export-if-defined=__start_em_asm
	--export-if-defined=__stop_em_asm
	--export-if-defined=__start_em_lib_deps
	--export-if-defined=__stop_em_lib_deps
	--export-if-defined=__start_em_js
	--export-if-defined=__stop_em_js
	--export-if-defined=main
	--export-if-defined=__main_argc_argv
	--export-if-defined=__wasm_apply_data_relocs
	--experimental-pic
	--unresolved-symbols=import-dynamic
	-shared
	--no-export-dynamic

from @mho22
@bgrgicak I suspect ImageMagick to add that option.

But based on the issue you shared from emscripten, this is maybe related to the --host.

from @bgrgicak
But based on the issue you shared from emscripten, this is maybe related to the --host.

Yes, I removed the --host and now I have a new error.

from @bgrgicak
I won't be able to do much more this week because I'm traveling to WCEU, but I will keep researching and focus on it again next week.

Error

#6 114.1   CXXLD    utilities/magick
#6 114.4 wasm-ld: error: attempted static link of dynamic object MagickCore/.libs/libMagickCore-7.Q16HDRI.so
#6 114.4 wasm-ld: error: attempted static link of dynamic object MagickWand/.libs/libMagickWand-7.Q16HDRI.so
#6 114.4 wasm-ld: error: attempted static link of dynamic object /root/ImageMagick-7.1.1-47/MagickCore/.libs/libMagickCore-7.Q16HDRI.so
#6 114.4 em++: error: '/root/emsdk/upstream/bin/wasm-ld -o utilities/.libs/magick.wasm -L/root/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten utilities/magick.o MagickCore/.libs/libMagickCore-7.Q16HDRI.so MagickWand/.libs/libMagickWand-7.Q16HDRI.so /root/ImageMagick-7.1.1-47/MagickCore/.libs/libMagickCore-7.Q16HDRI.so -lGL-getprocaddr -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmp_7ndtcuxlibemscripten_js_symbols.so --export=_emscripten_stack_alloc --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export=emscripten_stack_get_current --export=_emscripten_stack_restore --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-table -z stack-size=65536 --no-growable-memory --initial-heap=16777216 --no-entry --table-base=1 --global-base=1024' failed (returned 1)
#6 114.5 make[1]: *** [Makefile:8229: utilities/magick] Error 1

Command that fails

/root/emsdk/upstream/bin/wasm-ld
    -o
        utilities/.libs/magick.wasm
    -L/root/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten
        utilities/magick.o
        MagickCore/.libs/libMagickCore-7.Q16HDRI.so
        MagickWand/.libs/libMagickWand-7.Q16HDRI.so
        /root/ImageMagick-7.1.1-47/MagickCore/.libs/libMagickCore-7.Q16HDRI.so
    -lGL-getprocaddr
    -lal
    -lhtml5
    -lstubs
    -lnoexit
    -lc
    -ldlmalloc
    -lcompiler_rt
    -lc++-noexcept
    -lc++abi-noexcept
    -lsockets
    -mllvm
    -combiner-global-alias-analysis=false
    -mllvm
    -enable-emscripten-sjlj
    -mllvm
    -disable-lsr
        /tmp/tmpaqa8tdqilibemscripten_js_symbols.so
    --export=_emscripten_stack_alloc
    --export=__get_temp_ret
    --export=__set_temp_ret
    --export=__wasm_call_ctors
    --export=emscripten_stack_get_current
    --export=_emscripten_stack_restore
    --export-if-defined=__start_em_asm
    --export-if-defined=__stop_em_asm
    --export-if-defined=__start_em_lib_deps
    --export-if-defined=__stop_em_lib_deps
    --export-if-defined=__start_em_js
    --export-if-defined=__stop_em_js
    --export-if-defined=main
    --export-if-defined=__main_argc_argv
    --export-table
    -z
        stack-size=65536
    --no-growable-memory
    --initial-heap=16777216
    --no-entry
    --table-base=1
    --global-base=1024'


"

@bgrgicak
Copy link
Collaborator Author

@mho22 @adamziel @brandonpayton I moved my work on Imagick over from the private repo and made a few changes to make the build process similar to Xdebug.

All of this is experimental, and the code isn't something we should merge, but I wanted to hand over my progress as I won't be able to work on it for a while.

The issue description includes the current issue with library loading and a list of TODOs and development instructions.

@adamziel I'm reassigning the task and PR to you as you have the best idea about priorities and who could take over the work.

@bgrgicak bgrgicak assigned bgrgicak and adamziel and unassigned bgrgicak Jul 18, 2025
@bgrgicak
Copy link
Collaborator Author

PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) '/internal/shared/extensions/imagick.so' in Unknown on line 0

This is probably related to -sSIDE_MODULE=2, without it I would get this error.

<b>Warning</b>:  PHP Startup: Unable to load dynamic library '/internal/shared/extensions/imagick.so' (tried: /internal/shared/extensions/imagick.so (Could not load dynamic lib: /internal/shared/extensions/imagick.so
Error: need the dylink section to be first), /usr/local/lib/php/20230831//internal/shared/extensions/imagick.so.so (Could not load dynamic lib: /usr/local/lib/php/20230831/internal/shared/extensions/imagick.so.so
Error: ENOENT: no such file or directory, open '/usr/local/lib/php/20230831/internal/shared/extensions/imagick.so.so')) in <b>Unknown</b> on line <b>0</b><br />

@mho22
Copy link
Collaborator

mho22 commented Jul 18, 2025

@bgrgicak Thank you for your amazing work! I'd be happy to contribute to this PR, if it's a priority.

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 this pull request may close these issues.

3 participants