How to Fix Configure: error: xml2-config Not Found in Linux

In some cases, when you try to install PHP stable from source on Linux, you could get this error:

checking libxml2 install dir… no
checking for xml2-config path…
configure: error: xml2-config not found. Please check your libxml2 installation.

To fix it, let’s install package libxml2-dev for:

CentOS/RHEL

sudo yum install libxml2-devel

Debian/Ubuntu

sudo apt install libxml2-devel

Leave a Comment

Required fields are marked *