Hi!

I am getting the following error when trying to configure php 5.1.6 with apache 2.2 with libxml on solaris. I have libxml2-2.6.26 built and installed. The configure script fails with the following error

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /local/build/php5/libxml2
checking whether libxml build works... no
configure: error: build test failed. Please check the config.log for details.
Compiling (15mins) ...
make: Fatal error: No arguments to build
Installing (10mins) ...
make: Fatal error: Don't know how to make target `install'

The config.log says
configure:18250: checking whether to enable dmalloc
configure:18338: checking whether to enable IPv6 support
configure:18368: checking how big to make fd sets
configure:18388: checking whether to enable versioning
configure:18440: checking whether to enable LIBXML support
configure:18487: checking libxml2 install dir
configure:18647: checking whether libxml build works
configure:18674: gcc -o conftest -g -O2 -pthreads -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.2 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.2 -R/local/build/php5/libxml2/lib -L/local/build/php5/libxml2/lib conftest.c

     -lresolv -lm -ldl -lnsl -lsocket  -lgcc -lxml2 -lz [COLOR=DarkRed]-liconv[/COLOR] -lm -lsocket -lnsl 1>&5

configure: failed program was:
#line 18663 "configure"
#include "confdefs.h"

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

The problem seems to be with -liconv option. I am not sure why the dependency on the libconv library is introduced. It does not run into issues and runs to completion if I just copy the library to the default search path of /usr/lib. However, I run into the issue if I run configure with --with-iconv option specifying the actual installation directory.

does anyone know why the iconv dependency is caused and how to resolve it without copying the library to the default search path. your help is appreciated.

    Have you tried using Apache 2.0 instead of Apache 2.2 ?

    I'm pretty sure there are a number of issues running PHP with Apache 2.2. Although they can be resolved, the process can be a bit cumbersome. This would be my first port of call and then see if you get the same error(s).

    Jon

      Yes. I have tried it on 2.0 as well and get the same error.

        I have a similar problem, not sure exactly same or not. With PHP5.1.6 -

        My configure command is plain :- ./configure

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

        And the log file says -

        -lresolv -lm -ldl -lnsl -lxml2 -lz -lm 1>&5
        /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libxml2.so when searching for -lxml2
        /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libxml2.a when searching for -lxml2
        /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld: cannot find -lxml2
        collect2: ld returned 1 exit status
        configure: failed program was:
        #line 19982 "configure"
        #include "confdefs.h"

        libxml is installed with RPM -

        rpm -qa | grep libxml
        libxml2-2.6.12-3.4
        libxml-1.8.17-369.2
        libxml2-devel-2.6.12-3.4
        libxml2-32bit-9.2-200412202043
        perl-libxml-perl-0.07-480

        Any idea?

          God these problems happen so much, it's such a pain for people. Try Googling Uniform Server, it has everything all in one neat folder, much easier.

            PHP 5 and Apache 2.2 won't work together typically as some of the bridges don't work. You'll have to wait for later releases to work with Apache 2.2. I'm sure it stems from the same issue.

              It looks like configure script is looking for -lxml2 under /usr/lib even if I use --with-libdir=/usr/lib64. I put links in /usr/lib/ to /usr/lib64/libxml2.so.2.6.12, then it compiles. How can I force it read them from /usr/lib64?

                bpat1434 wrote:

                PHP 5 and Apache 2.2 won't work together typically as some of the bridges don't work. You'll have to wait for later releases to work with Apache 2.2. I'm sure it stems from the same issue.

                Oh yea yea, get Apache 2.0, I think that works.

                  apache 2.0 DOES work with php5. Apache 2.2 has modifications and the php5apache2.dll doesn't work due to the changes they made. So yes, 2.0 does work.

                    Write a Reply...