二维码

提示报错configure: error: xml2-config not found. Please check your libxml2 installation.

2089 人阅读 | 时间:2018年12月05日 21:17

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

centos 6.5 安装 PHP 5.6 报 configure error xml2-config not found. please check your libxml2 installation 错误

检查是否安装了libxm包

[root@rh-linux software]# rpm -qa |grep libxml2 
libxml2-2.6.26-2.1.12 
libxml2-python-2.6.26-2.1.12

提示报错configure: error: xml2-config not found. Please check your libxml2 installation.

提示报错configure: error: xml2-config not found. Please check your libxml2 installation.

重新安装libxml2和libxml2-devel包, yum安装的时候发现新版本会提示更新,需要更新的可以更新,不要跳过就行了。

[root@rh-linux /]# yum install libxml2 
[root@rh-linux /]# yum install libxml2-devel -y

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

[root@rh-linux /] # find / -name “xml2-config” 
/usr/bin/xml2-config

编译安装php时遇到virtual memory exhausted: Cannot allocate memory

有时候用vps建站时需要通过编译的方式来安装主机控制面板。对于大内存的VPS来说一般问题不大,但是对于小内存,比如512MB内存的VPS来说,很有可能会出现问题,因为编译过程是一个内存消耗较大的动作。 
本人近期就遇到一个这样的问题:在512MB内存centos操作系统的VPS上编译安装某国内主机控制面板,在编译安装php时日志中有如下错误记录:

virtual memory exhausted: Cannot allocate memory make: * 
[ext/fileinfo/libmagic/apprentice.lo] Error 1

开始时的解决方法是先将很多的进程关闭,比如httpd、ftpd、sendmail等等,释放出了一部分内存后,再进行编译,仍然得到同样的编译错误。后来百度谷歌了很久才找到解决问题的方法,而且是在php.net上找到的解决方法,原文链接是:https://bugs.php.net/bug.php?id=48809 
在回复中可以看到

Adding –disable-fileinfo to ./configure solves the problem.

根据这个文章的方法将php安装配置文件中加了引号中的配置(不包括引号)“–disable-fileinfo”后终于编译通过。这里分享出来供参考。



在编译PHP 的时候可能会出现找不到套件或套件错误的错误讯息。


找不到apxs 路径


在重新编译PHP时出现找不到apxs路径的错误讯息:
./configure: /usr/sbin/apxs: No such file or directory 

解决方式如下:
1.安装Apache的扩展套件apxs,这是httpd-devel之中的一个套件,可以用yum将其安装:
# yum -y install httpd-devel 

2.利用指令确认安装位址:
# which apxs 
/use/sbin/apxs


找不到xml2-config


在编译PHP的时候出现找不到xml2-config的错误讯息:
configure: error: xml2-config not found. Please check your libxml2 installation. 

解决方式:
使用yum安装libxml2及libxml2-devel套件:
# yum -y install libxml2 libxml2-devel


OpenSSL 错误


错误讯息:
Checking for pkg-config… /usr/bin/pkg-config 
configure: error: Cannot find OpenSSL's

重新安装openssl及openssl-devel:
# yum install openssl openssl-devel


Bzip2 错误


错误讯息:
Configure: error: Please reinstall the BZip2 distribution 

如果出现Bzip2的错误,可以重新安装bzip2。
因为yum找不到bzip2套件,可直接去官网下载:
http://www.bzip.org/ 

下载完后执行安装:
# tar zxvf bzip2-1.0.5.tar.gz 
# cd bzip2-1.0.5 
# make install 
# yum -y install openssl-devel


gmp 错误


错误讯息:
configure: error: Unable to locate gmp.h 

重新安装gmp-devel:
# yum -y install gmp-devel


curl 错误


错误讯息:
Configure: error: Please reinstall the libcurl distribution - 
easy.h should be in

/include/curl/ 

重新安装curl-devel:
# yum install curl curl-devel


libjpeg 错误

错误讯息:
Configure: error: libjpeg.(also) not found. 

重新安装libjpeg-devel及libjpeg:
# yum install libjpeg libjpeg-devel


libpng 错误

错误讯息:
Configure: error: libpng.(also) not found. 

重新安装libpng-devel及libpng:
# yum install libpng libpng-devel


freetype 错误

错误讯息:
Configure: error: freetype.h not found. 

重新安装freetype-devel:
# yum install freetype-devel


libmcrypt 错误

错误讯息:
configure: error: mcrypt.h not found. Please reinstall libmcrypt. 

重新安装libmcrypt及libmcrypt-devel:
# yum install libmcrypt libmcrypt-devel


MySQL 错误

错误讯息:
Configure: error: Cannot find MySQL header files under /usr. 
Note that the MySQL client library is not bundled anymore! 

重新安装mysql-devel:
# yum install mysql-devel



ncurses 错误

错误讯息:
Configure: error: Please reinstall the ncurses distribution 

重新安装ncurses及ncurses-devel:
# yum install ncurses ncurses-devel


unixODBC 错误

错误讯息:
Checking for unixODBC support… configure: error: ODBC header file '/usr/include/sqlext.h' not found! 

重新安装unixODBC-devel:
# yum install unixODBC-devel


pspell 错误

错误讯息:
Configure: error: Cannot find pspell 

重新安装pspell-devel:
# yum install pspell-devel



mcrypt 错误

错误讯息:
configure: error: mcrypt.h not found. Please reinstall libmcrypt. 

重新安装libmcrypt及libmcrypt-devel:
# yum install libmcrypt libmcrypt-devel


snmp 错误

错误讯息:
Configure: error: snmp.h not found. Check your SNMP installation. 

重新安装net-snmp及net-snmp-devel:
# yum install net-snmp net-snmp-devel


©著作权归作者所有:来自ZhiKuGroup博客作者没文化的原创作品,如需转载,请注明出处,否则将追究法律责任 来源:ZhiKuGroup博客,欢迎分享。

评论专区
  • 昵 称必填
  • 邮 箱选填
  • 网 址选填
◎已有 3 人评论
  • 访客  发表于 3个月前
    1楼

    楼主的头像能辟邪啊!http://2omx.jsdtyljx.com/

  • 访客  发表于 3个月前
    2楼

    这个帖子会火的,鉴定完毕!http://3bi.net/post/2655.html/

  • 访客  发表于 2个月前
    3楼

    看帖不回帖的人就是耍流氓,我回复了!http://9675.shenxiuxia.com/

搜索
作者介绍
30天热门
×
×
本站会员尊享VIP特权,现在就加入我们吧!登录注册×
»
会员登录
新用户注册
×
会员注册
已有账号登录
×