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

  mysql, question

Under Linux, errors are reported when compiling and installing PHP:

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

However, libxml2 has been installed under Linux, and I can find it through rpm-QA | grepllibxml2. then why should I prompt that error?

Should be libxml2-dev

ubuntu/debian:

apt-get install libxml2-dev

centos/redhat:

yum install libxml2-devel