At first PHP's configure script would fail saying that my version of libxml was too old. I eventually modified my sources.list (I'm using Debian 3.0r2) to use testing code instead of stable and apt-get'ed libxml so I am now upgraded above what PHP requires. However, I still have trouble around the same point as I did before (libxml stuff).

Here is the last part of the configure output (./configure --with-apxs --with-pgsql):

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking whether libxml build works... no
configure: error: build test failed.  Please check the config.log for details.

I have also tried --with-libxml-dir but the only thing that did was "checking libxml2 install dir... yes"

And here is the relevant last part of the config.log:

configure:17846: checking whether to enable LIBXML support
configure:17893: checking libxml2 install dir
configure:18053: checking whether libxml build works
configure:18080: gcc -o conftest -g -O2   conftest.c

     -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm 1>&5
/usr/lib/libxml2.a(threads.o): In function `xmlGetGlobalState__internal_alias':
threads.o(.text+0x2b9): undefined reference to `pthread_once'
threads.o(.text+0x2c6): undefined reference to `pthread_getspecific'
threads.o(.text+0x2e9): undefined reference to `pthread_setspecific'
/usr/lib/libxml2.a(threads.o): In function `xmlIsMainThread__internal_alias':
threads.o(.text+0x326): undefined reference to `pthread_once'
/usr/lib/libxml2.a(threads.o): In function `xmlOnceInit':
threads.o(.text+0x3b6): undefined reference to `pthread_key_create'
collect2: ld returned 1 exit status
configure: failed program was:
#line 18069 "configure"
#include "confdefs.h"


char xmlInitParser();
int main() {
  xmlInitParser();
  return 0;
}

It appears as though I am missing a library as the linker is throwing errors (possibly I just have an incorrect directory?). Thanks for any help.

    where do you have libxml2 installed, and what does your complete configure command look like?

      Actually, I just fixed it and I'm not really sure how I knew to do what I did.

      By the way, my complete configure was this:
      ./configure --with-apxs --with-pgsql
      And I have libxml installed to /usr/lib.

      I ended up having to apt-get remove libxml2-devel and then apt-get install libxml2-dev (I guess there are some problems between the two, I think the devel package is gnome related the dev package is general xml stuff). Anyways, once I did that, the configure worked fine.

      Of course I am able to figure this out 5 minutes after I post it after spending several hours on it yesterday. Oh well, hopefully this will help someone in a similar situation.

        EDIT: nm, just read that your configure worked fine after snagging libxml2 😃

          5 years later

          i got it fixed.

          i did a yum install libxml-2

          After that i located the libxml-2 file and then copied and pasted into the location that php was searching for

            Write a Reply...