Now: Tutorial for Web and Software Design > PHP > QA > PHP Content
> PHPFAQ - I have errors trying to install libxml so I can use --with-dom for PHP (checking for DOM in default path... not found)? [Bookmark it]
PHPFAQ - I have errors trying to install libxml so I can use --with-dom for PHP (checking for DOM in default path... not found)?


Question :

I have errors trying to install libxml so I can use --with-dom for PHP (checking for DOM in default path... not found)?

Answer :This is an example that works for us. It may not work for you but its a start.

Before reinstalling PHP you need the libxml librarys.
wget ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.4/libxml2-2.4.28.tar.gz
tar -pxzf libxml2-2.4.28.tar.gz
cd libxml2-2.4.28
./configure --with-zlib
make
make install

Check /etc/ld.so.conf for the line /usr/lib if its there don't worry about the next step, if its not then add it.

Then run ldconfig

Then create a symlink so PHP knows where to find the librarys :-
ln -s /usr/local/include/libxml2/libxml /usr/local/include/libxml

Before we added this line we were getting the following error on the PHP cofigure :-
checking for DOM in default path... not found
configure: error: Please reinstall the libxml >= 2.2.7 distribution

A search of google found nothing so we went hunting in the configure source.

The basic check does the following, if a directory is supplied int he configure line for the DOM librarys it looks for :-
DIR/include/libxml/tree.h (DIR being the path you supplied)

If it can't find it or its not supplied it then goes to /usr and /usr/local it then runs through adding /include/libxml/tree.h to each one looking for the librarys.

The symlink basically means that :-
/usr/local/include/libxml/tree.h exists and points to /usr/local/include/libxml2/libxml/tree.h

We also had to create one more symlink
ln -s /usr/lib/libxml2.a /usr/lib/libxml.a

This had the desired effect of allowing PHP to configure and build.

Update
We just tried the above install for php4.2.2 we got the following error :-
checking for libxml version... configure: error: libxml version 2.4.2 or greater required.

Removing the directory :-

/usr/local/include/libxml

and re-running
ln -s /usr/local/include/libxml2/libxml /usr/local/include/libxml

Fixed the error


[Bookmark][Print] [Close][To Top]
  • Prev Article-PHP:

  • Next Article-PHP:
  • Related Materias
    PHPFAQ - How google is you
    PHPFAQ - Are there any web
    PHPFAQ - How can I accept 
    PHPFAQ - How can I finance
    PHPFAQ - Where can I get P
    PHPFAQ - Where can I host 
    PHPFAQ - Where can I find 
    PHPFAQ - I am trying to cr
    PHPFAQ - Is there a librar
    PHPFAQ - How can I manage 
    Topics
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Graphic Design Tutorial
     

    Coreldraw Tutorial

      Illustrator Tutorial
      3D Graphics Articles
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial&Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial&Articles
     

    XML Style Tutorial

      AJAX Tutorial
      XML Mobile
    Flash Tutorial&Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial&Articles
     

    Linux Tutorial

      Symbian Tutorial
      MacOS Tutorial