编译php报错xml2-config not found. Please check your libxml2 installation

编译php报错xml2-config not found. Please check your libxml2 installation

已有 457 次阅读   2012-08-04 18:38    标签:   php 
Configuring extensions
checking size of long... (cached) 4
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... /usr
checking for xml2-config path... 
configure: error: xml2-config not found. Please check your libxml2 installation.
解决方法:

检查是否安装了libxm包

[root@XKWB3403 php-5.3.8]# rpm -qa |grep  libxml2
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12

 

重新安装libxml2和libxml2-devel包

yum install libxml2

yum install libxml2-devel -y

 

安装完之后查找xml2-config文件是否存在

[root@XKWB3403 php-5.3.8]# find / -name "xml2-config"
/usr/bin/xml2-config

 

如果存在的话重新安装php

[root@XKWB3403 php-5.3.8]# ./configure 

Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
creating sapi/cli/php.1
creating sapi/fpm/php-fpm.conf
creating sapi/fpm/init.d.php-fpm
creating sapi/fpm/php-fpm.8
creating sapi/fpm/status.html
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

Notice: Following unknown configure options were used:

--enable-discard-path
--enable-fastcgi
--enable-force-cgi-redirect

Check './configure --help' for available options
特别注意:编译php时需要解决依赖关系,所以在编译之后先要安装php所需的关系组件。

你可能感兴趣的:(Linux)