# libxml2 build for php 5.2 on windows

- Thread: https://externals.io/message/25641
- Original archive: https://news-web.php.net/php.internals/25641
- Started by Stanislav Malyshev on 2006-09-12T21:48:33+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #25641 — Stanislav Malyshev — 2006-09-12T21:48:33+00:00

URL: https://externals.io/message/25641#25641

I am trying to build php 5.2 on Windows with Visual. So far I managed to
build everything except for libxml2 dependencies, which do not seem to
work. So could anyone please clarify the following matters:
1. What libxml2 version is required for 5.2 build?
2. Should 5.2 build use static or dynamic (dll) version of libxml2?
3. libxml.c seems to use symbol xmlDllMain - which is built in libxml2
only when LIBXML_STATIC_FOR_DLL symbol is defined, however standard
builds of libxml2 never define this symbol, at least in latest version
2.6.26.
4. General question - PHP 5 requires a number of libraries that PHP 4
did not, such as iconv, libxml2, etc. However, these libraries are not
included in win32build package, and also binaris available online not
always work cleanly with PHP. Would not it be good to update this
package with all binaries needed to build standard PHP 5?

-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/

---

## #25642 — Rob Richards — 2006-09-13T00:59:55+00:00

URL: https://externals.io/message/25641#25642 · In reply to: #25641

Stanislav Malyshev wrote:
> I am trying to build php 5.2 on Windows with Visual. So far I managed to
> build everything except for libxml2 dependencies, which do not seem to
> work. So could anyone please clarify the following matters:
> 1. What libxml2 version is required for 5.2 build?
>   
2.6.26 built using the LIBXML_STATIC_FOR_DLL flag.
> 2. Should 5.2 build use static or dynamic (dll) version of libxml2?
>   
It should be using the static version included from:
http://ctindustries.net/libxml/. The library was not renamed as to 
minimize the change.
> 3. libxml.c seems to use symbol xmlDllMain - which is built in libxml2
> only when LIBXML_STATIC_FOR_DLL symbol is defined, however standard
> builds of libxml2 never define this symbol, at least in latest version
> 2.6.26.
>   
I am working on getting this lib built by default within the standard 
release. At that time, I will change the required lib as I have proposed 
to name it libxml2_a_dll.lib.
> 4. General question - PHP 5 requires a number of libraries that PHP 4
> did not, such as iconv, libxml2, etc. However, these libraries are not
> included in win32build package, and also binaris available online not
> always work cleanly with PHP. Would not it be good to update this
> package with all binaries needed to build standard PHP 5?
>   
This would  require the win32build package to be versioned so that the 
correct version of libxml2 is used (needs to support the symbols being 
exported from the .def file).

Rob

---

## #25643 — Stanislav Malyshev — 2006-09-13T01:16:04+00:00

URL: https://externals.io/message/25641#25643 · In reply to: #25642

Hi!
Thanks for the quick answer!
> 2.6.26 built using the LIBXML_STATIC_FOR_DLL flag.
Ehm, ok. The problem is that it is not possible to define this flag in
any way but by hand-editing makefile. Which reinforces my point about
keeping working one in win32build zip.

> It should be using the static version included from:
> http://ctindustries.net/libxml/. The library was not renamed as to
> minimize the change.
This URL does not seem to be alive, anyway - what is this URL? It's not
standard libxml2 place - where one finds it out (except for asking on
the list each time one want to build PHP ;)
> I am working on getting this lib built by default within the standard
> release. At that time, I will change the required lib as I have
> proposed to name it libxml2_a_dll.lib.
Please do not forget to update .dsp files then.
> This would  require the win32build package to be versioned so that the
> correct version of libxml2 is used (needs to support the symbols being
> exported from the .def file).
Does it mean older PHP versions won't build with newer libxml? Ouch.
Then I guess we need versioned files. Because right now building 5.2 on
windows is very non-obvious to say the least and there's no reason why
it should stay that way. Anyway, since older version did not have libxml
at all, I think it won't be too bad adding one,

-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/

---

## #25644 — Rob Richards — 2006-09-13T01:40:54+00:00

URL: https://externals.io/message/25641#25644 · In reply to: #25643

Stanislav Malyshev wrote:
>  Hi!
> Thanks for the quick answer!
>   
> > […]
> Ehm, ok. The problem is that it is not possible to define this flag in
> any way but by hand-editing makefile. Which reinforces my point about
> keeping working one in win32build zip.
>   
Right. I have a patch that I asked some of the people who distribute 
windows builds of libxml2 to take a look at so that the lib gets built 
by default.
>   
> > […]
> This URL does not seem to be alive, anyway - what is this URL? It's not
> standard libxml2 place - where one finds it out (except for asking on
> the list each time one want to build PHP ;)
>   
It should be as i just checked it. It contains the builds I have been 
maintaining for the past few years now and the ones Edin uses for the 
windows builds. The libxslt build there has been required from day one 
cause it a customized build. It's just recent that the libxml2 build is 
now non-standard as well.
At that URL you should find both release and debug builds of libxml2 and 
libxslt specifically for building with PHP.
> > […]
> Please do not forget to update .dsp files then.
>   
> > […]
> Does it mean older PHP versions won't build with newer libxml? Ouch.
> Then I guess we need versioned files. Because right now building 5.2 on
> windows is very non-obvious to say the least and there's no reason why
> it should stay that way. Anyway, since older version did not have libxml
> at all, I think it won't be too bad adding one,
>   
Older versions will still build with the standard libxml2 builds, just 
not the ones I provide. They will compile, but the thread cleanup 
handling will be a bit pooched. Best I could do if this is absolutely 
necessary is to build and provide all 3 libs and change the code on the 
recent branches (we've change 6, 5.2 and domxml in 4.4) to use 
libxml2_a_dll.lib (my proposed name for the new library).

Rob

---

## #25645 — Stanislav Malyshev — 2006-09-13T01:50:12+00:00

URL: https://externals.io/message/25641#25645 · In reply to: #25644

> Right. I have a patch that I asked some of the people who distribute 
> windows builds of libxml2 to take a look at so that the lib gets built 
> by default.

BTW: standard windows build of libxml2 (one advertised on their 
homepage) is not usable with Visual Studio 6 - it is built with VS7 
which has different library symbols.

> It should be as i just checked it. It contains the builds I have been 
Yes, it works now, probably was some transient problem in my network. I 
checked and the build is OK with your library, thanks.
