Open ganeshkbhat opened 1 year ago
You either need to tell php not to build with libxml support, or you need to configure and build libxml prior to configuring php.
My advise would be to first try to disable libxml support in php. See the line checking whether to build with LIBXML support... yes
.... if you can get it so decide it doesn't need LIBXML at all that would be best. There may be an option for this.
Failing that you need to look into building libxml first.
None of this is unique to emscripten or emsdk.. this is just normal autoconf stuff.
Cross-posted at https://github.com/php/php-src/issues/11617.
frankly, i was trying to do th same but the docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emconfigure ./configure --disable-libxml
failed even with the disable tag. i also tried with giving the flag paths for libxml needed flags and it failed. probably it did not take the flag at all. i installed with apt-get install libxml2
but did not try with libxml2-dev
I am trying to build the r-lang project using the command /workspaces/codespaces-blank/emsdk/upstream/emscripten/emconfigure ./configure
and the /workspaces/codespaces-blank/emsdk/upstream/emscripten/emcmake make
and get simlar error for ./configure where is not able to find the installed gofortran
(both gfortran and gfortran-9-dev are installed) - /workspaces/codespaces-blank/emsdk/upstream/emscripten/emconfigure ./configure MAKE=gmake
You either need to tell php not to build with libxml support, or you need to configure and build libxml prior to configuring php.
My advise would be to first try to disable libxml support in php. See the line
checking whether to build with LIBXML support... yes
.... if you can get it so decide it doesn't need LIBXML at all that would be best. There may be an option for this.Failing that you need to look into building libxml first.
None of this is unique to emscripten or emsdk.. this is just normal autoconf stuff.
No @sbc100 @SagaraBattousai . I was not able to build it with --disable-xx
command and with libxml
libxml2
command available.
Similar porblems existed with R-Lang when trying to build the project executable to .wasm
file.
If your project has a hard requirement of libxml2 you would need to first build libxml2 using emscripten and then tell your project how to find it when configuring.
Somewhat related – WordPress Playground builds PHP to wasm using Emscripten and supports building both with and without libxml, see the build script for inspiration. I also wrote this blog post FWIW: Learn how to build PHP to WebAssembly in 10 minutes.
I am failing when trying to build
php.wasm
(php-cli.wasm
). What am I doing wrong? It is asking me to give flags forlibxml
which is not there in./configure
command only but there withdocker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk emconfigure ./configure
config.log
This is what happens when you run just the
./configure
command.