centos 安装 libiconv

安装方法如下:

cd /usr/local/src
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
配置
./configure --prefix=/usr/local/libiconv
编译
make
安装
make install
建立软连接
ln -s /usr/local/lib/libiconv.so /usr/lib
ln -s /usr/local/lib/libiconv.so.2 /usr/lib

本人使用的是Cenos 7.0系统,因PHP需要 在编译安装libiconv-1.14时遇到如下问题:

故障1、 未安装GCC

cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
configure: error: in `/home/gitlab/tools/libiconv-1.14':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

这个问题是因为没有安装GCC程序
解决办法:

yum install gcc -y

故障2、在make时报如下错误

In file included from progname.c:26:0:
./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
^
make[2]: *** [progname.o] Error 1
make[2]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib'
make: *** [all] Error 2
解决办法:
cd  srclib/   #进入libiconv目录下的srclib
sed -i -e '/gets is a security/d' ./stdio.in.h
 

 

 
posted @ 2019-07-08 16:18  一个人的孤独自白  阅读(4510)  评论(0编辑  收藏  举报