How to fix error with xml2-config not found when installing PHP from sources?

TroodoN-Mike picture TroodoN-Mike · Nov 11, 2013 · Viewed 152.4k times · Source

When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from http://www.php.net/downloads.php) and I run ./configure I get this error:

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

Answer

TroodoN-Mike picture TroodoN-Mike · Nov 11, 2013

All you need to do instal install package libxml2-dev for example:

sudo apt-get install libxml2-dev

On CentOS/RHEL:

sudo yum install libxml2-devel