今天在安装PHP的时候.

./configure --prefix=/usr/local/php5 --with-gd --with-zlib --with-mysql=/usr/local/mysql/ --with-config-file-path=/usr/local/php5 --enable-mbstring --enable-fpm

先是报出如下错误:

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

解决办法:

安装libxml2-devel,因为rpm -aq |grep libxml2 的时候显示libxml2本身已经安装;

 yum -y install libxml2

解决之后再次configure, 这次报出如下错误:

configure: error: libpng.(a|so) not found

 yum install libpng

解决之道差不多, 同样通过安装libpng-devel解决.