configure: error: xml2-config not found. Please check your libxml2 installation.

I got this error when trying to configure php 5.2.6:

configure: error: xml2-config not found. Please check your libxml2 installation.

I’m using Debian and it showed that I had libxml2 installed (and it was the latest version).

It turns out that the latest stable version of libxml2 doesn’t include a file named xml2-config. I suppose I could have linked that file to the config file that the stable version of libxml2 uses, but the easy fix is to just install the newer development version of libxml2 using the following command:

apt-get install libxml2-dev

That’s all I needed!

Tagged with: , , , , , , ,
Posted in software development
15 comments on “configure: error: xml2-config not found. Please check your libxml2 installation.
  1. Rookie! says:

    Thanks dude!, now ./configure gives me:

    configure: error: Cannot find MySQL header files under yes.
    Note that the MySQL client library is not bundled anymore!

    I will keep on searching.

    Cheers!

  2. Asher Bond says:

    @ Rookie:

    Glad to help. Now you just need to install mysql-server. If I remember correctly, the apt-get command for that is:
    apt-get install mysql-server

    Then just make sure you are configuring php with a really general path (like /usr) or the proper path to the mysql header files.

  3. r1n0z33n says:

    thnx for this.a simple post,help me a lot 😀

  4. ganool says:

    # apt-get install libxml2-dev
    -bash: apt-get: command not found

    what the hell ?

  5. Juliet says:

    I have made several tweets relating to some of the favorite articles that you have posted. Your work actually means a lot to me, thanks.

  6. vt says:

    Thx alot!

  7. Rahul Jain says:

    I was getting the same problem –
    configure: error: Cannot find MySQL header files under yes.
    Note that the MySQL client library is not bundled anymore!

    and I did –
    apt-get install mysql-server

    This installed mysql but I did not get any header files. So, just for benefit of guys who get same problem, you need to install dev version –
    DO –
    apt-get libmysql++-dev

  8. Vivek Thomas says:

    Thanks for that, faced the same problem when installing aria2 😛

  9. Nitesh says:

    Hi,
    i am installing ‘NetMG’ tool to display graphs on web, but im facing the problem while installing ‘libxml2-2.7.7.tar.gz’ get the error “configure: error: XML2 libraries not found. Use –with-xml2-lib-dir=” and i also tried what you said earlier….

    plz help

  10. Lee Murray says:

    1.how can I install the latest version without the package manager?

    2. what version of libxml was causing the problem?

    3. which dev version solved the problem?

  11. Andy says:

    Hello,
    My name is Arjun aka Andy, and i am one of developer for linux. I give you 10/10 for this solution. This solution inform us that Linux is still unbeatable @ 0 price. Keep learning, and keep solving.

  12. Dan says:

    Thanks, this helped me fix my problem.

    Dan

  13. Risal says:

    Great!!! tahnk you so much

  14. Kapil says:

    solved it using below:

    yum install libxml2-devel