kalyanrajsista has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I'm trying to install XML::LibXML on Linux box, but getting the following errors. Please help me out to resolve this. I've downloaded

libxml2-2.7.6.tar from ftp://xmlsoft.org/libxml2/
and installed it on my system. But still unsuccessful.
$ perl Makefile.PL enable native perl UTF8 running xml2-config...ok (2.7.6) looking for -lxml2... no looking for -llibxml2... no libxml2 not found Try setting LIBS and INC values on the command line Or get libxml2 from http://xmlsoft.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are. Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter to see the exact reason why the detection of libxml2 installation failed or why Makefile.PL was not able to compile a test program.

Replies are listed 'Best First'.
Re: Unable to install XML::LibXML
by moritz (Cardinal) on Nov 12, 2009 at 13:41 UTC

    In which path did you install libxml2? I expect Makefile.PL to only search the standard directories for libraries and headers (like /lib/ and /usr/lib/), if you installed it somewhere else you need to tell it about those paths.

    Perl 6 - links to (nearly) everything that is Perl 6.
      <code> my $PATH variable showing the /usr/lib directory.still it is not working

        The PATH environment variable is unrelated to the compiler/linker finding libraries...

        But as you're saying you have the lib installed in /usr/lib (which is a default library search path), I suppose the problem is that the installation somehow didn't succeed...  Did you actually run ./configure --prefix=/usr ; make install (the default installation prefix would be /usr/local) from the directory where you unpacked the libxml2 sources (the tarball you downloaded), and did the build and installation complete without errors? 

        That's not quite what I asked.

        What steps did you do to install libmlx2?

Re: Unable to install XML::LibXML
by gmargo (Hermit) on Nov 12, 2009 at 15:26 UTC

    What OS are you using? If it's a Linux distribution, it is likely that precompiled binaries are available.

      i am using linux :Linux 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 i686 i386 GNU/Linux

        That's the kernel you're using. But what distribution (and what version of distribution)? I'm guessing perhaps a RHEL, Fedora, or CentOS installation?

        Update 1: Looks like that kernel was distributed with CentOS 4.6.

        Update 2: Both libxml2 and XML::LibXML are available from the CentOS 4.6 archives. These are much older versions than current of course, since 4.6 is pretty darn old. These are the packages, install using a package manager.

        • libxml2-2.6.16-10.i386.rpm
        • libxml2-devel-2.6.16-10.i386.rpm
        • perl-XML-LibXML-1.58-1.i386.rpm

        Perhaps it's time to upgrade that OS?

        Ok, enough sysadmin; back to perl!