在configure php时:

./configure --prefix=/home/php5.5.8 --with-apxs2=/home/apache/bin/apxs --with-mysql --with-mysqli --with-gd --enable-mbstring --enable-sockets --enable-shared --with-pdo-mysql --with-jpeg-dir=/usr/lib64 --with-freetype-dir=/usr/lib64 --with-png-dir=/usr/lib64 --with-curl

发生如下错误:

Configuring extensions
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

错误提示是libxml2安装是否有问题

通过查看libxml2的安装情况

其实是缺少libxml2-devel

ubuntu/debian:
apt-get install libxml2-dev
centos/redhat:
yum install libxml2-devel

然后重新执行configure,成功。或许你还会遇到类似的问题,如curl-devel没有安装会出现下面的错误:

configure: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/

解决办法一样

ubuntu/debian:
apt-get install curl-dev
centos/redhat:
yum install curl-devel

以及错误三:

If configure fails try --with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.

解决办法:

ubuntu/debian:
apt-get install libjpeg-dev
centos/redhat:
yum install libjpeg-devel

错误四:

If configure fails try --with-vpx-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
configure: error: png.h not found.

解决办法:

ubuntu/debian:
apt-get install libpng-dev
centos/redhat:
yum install libpng-devel

错误五:

If configure fails try --with-vpx-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.

解决办法:

ubuntu/debian:
apt-get install freetype-dev
centos/redhat:
yum install freetype-devel

 

发表评论