I'd thought I would post this to help those who may want to know how to get the libxml DOM extensions installed

PHP uses the Gnome XML library which is developed by www.xmlsoft.org

For Windows 32 platforms, the maintainer is Igor Zlatkovic. You can obtain the Windows 32 binaries here:
http://www.zlatkovic.com/projects/libxml/binaries.html

Download the libxml and iconv distributions
Copy iconv.dll and lib2xml.dll in the windows\system32 directory

Open up the php.ini file located in the windows directory
Remove the semicolon to enable:
extension=php_domxml.dll
Add the following:
extension_dir = c:\Php\php-4.2.2-Win32\extensions

Run phpinfo() and you will see the following:
domxml
DOM/XML enabled
libxml Version 2.4.21
HTML Support enabled
XPath Support enabled
XPointer Support enabled

To prove binding, run a simple call:
$dom = domxml_new_doc('1.0');

Hope this helps someone!

    Your Instructions helped me quite a lot:

    the last problem 2 fix:
    i have a version conflict on my php 4.3-System:

    "Unable to initialize module...
    Module compiled with API=20010901...
    PHP compiled with API=20020429...
    These options need to match"

    How can i compile them on my own? Or does anyone have the right ones for php4.3?

    one more question 2 the expert: Is there a possibility to use DOMXML on webservers, if it is not yet installed? (out-of-the-box-solution?)

    My prob: I need a function, that generates XML-Output out of an associative array WITHOUT DOMXML-extension. Anybody got one?

    thx a lot,

    Lex from Austria

      Thanks so much for your artical - it makes it very clear to me, but I still have a problem and a question. When I downloaded Igor's binaries I got llibxml2.dll not lib2xml.dll - is that ok?

      I have apache 2.0 and php 4.+ installed correctly on my XP home laptop with service pack 1. I put the iconv.dll and the libxml2.dll in c:\windows\system32, which is also in my path I updated the php.ini to

      extension=php_domxml.dll
      and
      extension_dir = c:\Php\extensions

      and have added:

      LoadModule php4_module c:\public_html\sapi\php4apache2.dll

      AddModule mod_php4.c

      AddType application/x-httpd-php .php

      to httpd.con for Apache where public_html is a virtual directory.

      I then ran a .php page with phpinfo() and got these results:

      PHP Version 4.3.0

      System Windows NT localhost 5.1 build 2600

      Build Date Dec 27 2002 05:28:00

      Server API Apache 2.0 Filter

      Virtual Directory Support enabled

      Configuration File (php.ini) Path C:\WINDOWS\php.ini

      PHP API 20020918

      PHP Extension 20020429

      Zend Extension 20021010

      Debug Build no

      Thread Safety enabled

      Registered PHP Streams php, http, ftp, compress.zlib

      xml
      XML Support active

      XML Namespace Support active

      EXPAT Version 1.95.2

      BUT- no XMLDOM information.

      I ran depends to check dependancies for libxml2.dll and had a missing efsadu.dll and once I had pulled that down from the dll page it was missing some calls on mpr.dll which I backed up but cannot overlay with another copy because it is a system file, and frankly I'm concerned about doing that without understanding what I'm doing.

      I have started/stopped/rebooted after each change to verify that I am loading the current module.

      Does anyone have any thoughts on where to go from here?

      It doesn't seem like this task should be so hard. -Thanks -Pat 😕

        7 years later

        Hey Kerry,

        I had to drop a note to says thanks for this posting. I cannot tell you the hours I have burned looking for a solution to properly install libxml2. Yours is the only one that was so clear, simple and helpful. Thank you for doing this.

        Frank

          Write a Reply...