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!

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!
@ 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.
thnx for this.a simple post,help me a lot
# apt-get install libxml2-dev
-bash: apt-get: command not found
what the hell ?
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.
Thx alot!
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
Thanks for that, faced the same problem when installing aria2
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
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?
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.
Thanks, this helped me fix my problem.
Dan
You bet Dan, glad it helped.
Great!!! tahnk you so much
solved it using below:
yum install libxml2-devel