xml2-config not found. Please check your libxml2 installation

chris (2007-06-04 10:42:31)
11132 views
2 replies
PHP5 comes with way better xml support, including a full suite of dom function which allow easy parsing, creating and manipulation of XML documents in PHP. The power under the hood of all this PHP XML goodness is the GNU libxml (or more correctly libxml2) library, which is a C library providing a vast array of XML functionality.

If you don't have this library installed, your PHP5 ./configure script will die with a line something like this:

xml2-config not found. Please check your libxml2 installation

This isn't a major problem.. All you have to do is find libxml2 and install it first. Hopefully the next few lines will make that quick and easy for you:
sudo wget ftp://xmlsoft.org/libxml2/libxml2-2.6.28.tar.gz
sudo tar -zxvf libxml2-2.6.28.tar.gz
cd libxml2-2.6.28/
./configure
make
sudo make install

if you don't have 'sudo' on your system, just omit the word 'sudo' from those commands, but make sure that you run them as root instead. One other caveat is that libxml2 might be at a higher version by the time you read this article, so to be sure, just point your browser or ftp client at ftp://xmlsoft.org/libxml2/ and check the latest build versions first

You are now ready to go back and configure PHP5.

hope that's useful

christo

follow me on twitter http://twitter.com/planet_guru
comment
Erich
2009-03-16 02:45:07

Perfect

Searched for a while and finally found your post. It's just what the Doc ordered.

Thanks.



PHP5 comes with way better xml support, including a full suite of dom function which allow easy parsing, creating and manipulation of XML documents in PHP. The power under the hood of all this PHP XML goodness is the GNU libxml (or more correctly libxml2) library, which is a C library providing a vast array of XML functionality.

If you don't have this library installed, your PHP5 ./configure script will die with a line something like this:

xml2-config not found. Please check your libxml2 installation

This isn't a major problem.. All you have to do is find libxml2 and install it first. Hopefully the next few lines will make that quick and easy for you:
sudo wget ftp://xmlsoft.org/libxml2/libxml2-2.6.28.tar.gz
sudo tar -zxvf libxml2-2.6.28.tar.gz
cd libxml2-2.6.28/
./configure
make
sudo make install

if you don't have 'sudo' on your system, just omit the word 'sudo' from those commands, but make sure that you run them as root instead. One other caveat is that libxml2 might be at a higher version by the time you read this article, so to be sure, just point your browser or ftp client at ftp://xmlsoft.org/libxml2/ and check the latest build versions first :)

You are now ready to go back and configure PHP5.

hope that's useful

christo
reply iconedit reply
pete
2009-03-26 08:44:40

better wget

Thanks for this tip.
To ensure you get the latest libxml2, change your wget to
wget ftp://xmlsoft.org/libxml2/LATEST_LIBXML2
reply iconedit reply