如何在CentOS 7中将libxml2升级到版本2.9.9?

时间:2019-08-30 06:43:04

标签: centos

我的步骤:

下载:

# wget ftp://xmlsoft.org/libxml2/libxml2-2.9.9.tar.gz

解压缩档案:

# tar -zxvf libxml2-2.9.9.tar.gz

进入目录:

# cd libxml2-2.9.9/

做些奇怪的事情:

# ./configure && make && make install

此命令返回错误:

checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/libxml2-2.9.9':
configure: error: no acceptable C compiler found in $PATH

命令:php -i | grep libxml产生以下结果:

PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
libxml
libxml2 Version => 2.9.1
OLDPWD => /root/libxml2-2.9.9
_SERVER["OLDPWD"] => /root/libxml2-2.9.9

命令:yum update-to libxml2-2.9.9-不起作用。

1 个答案:

答案 0 :(得分:1)

  

配置:错误:在$ PATH中找不到可接受的C编译器

解决方案:# yum install gcc-c++ ...即同时安装gcc和g ++还将安装所有使gcc正常工作的软件包。

注意:仅./configure将安装到/ usr / local /,并且不更新当前版本2.9.1。必填项

tar xvf libxml2-2.9.9.tar.gz
cd libxml2-2.9.9/
./configure --prefix=/usr --libdir=/usr/lib64
make
# make install
相关问题