您的位置:首页 > 运维架构 > Linux

搭建lnmp环境(一):准备工作 libiconv、mhash、libmcrypt、mcrypt 的库安装

2017-03-17 15:27 489 查看
安装环境:CentOs6.8 X64 minimal

准备软件:libiconv mhash libmcrypt mcrypt

一、准备安装

1. 连接SSH

2. 新建soft文件夹下载安装包

[root@localhost ~]# mkdir /root/soft && cd /root/soft


3. 下载wget下载列表文件 (url.txt)


[root@localhost soft]# wget https://raw.githubusercontent.com/u715577133/LinuxSoft/master/url.txt[/code] 
4. 下载安装包
wget -i 表示下载文件中出现的url文件。


[root@localhost soft]# wget -i url.txt


二、开始安装

1.安装iconv

[root@localhost]# tar -zxvf libiconv-1.15.tar.gz && cd libiconv-1.15
[root@localhost libiconv-1.15]# ./configure
...
configure: error: in `/root/soft/libiconv-1.15':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[root@localhost libiconv-1.15]# yum install gcc


提示no acceptable C .....需要安装gcc 编译器,直接执行 yun install gcc
安装完gcc以后 继续./configure


...
checking whether the -Werror option is usable... yes
checking for simple visibility declarations... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: executing libtool commands


走到这步一般不会报错,直接 make && make install
到这里iconv已经安装完成了。


2.安装mhash (hash支持)

[root@localhost soft]# tar -zxvf mhash-0.9.9.9.tar.gz && cd mhash-0.9.9.9
[root@localhost mhash-0.9.9.9]# ./configure && make && make install


3.安装libmcrypt

[root@localhost soft]# tar -zxvf libmcrypt-2.5.7.tar.gz
[root@localhost soft]# cd  libmcrypt-2.5.7 && ./configure && make && make install
...


这里不要退出libmcrypt目录继续安装让系统支持libcrypt

[root@localhost libmcrypt-2.5.7]# /sbin/ldconfig
[root@localhost libmcrypt-2.5.7]# ./configure --enable-ltdl-install


libmcrypt安装完成

4.mcrypt安装

[root@localhost soft]# tar -zxvf mcrypt-2.6.8.tar.gz && cd mcrypt-2.6.8 && install
...
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
*** 这里要指定LIBPARY_PATH路径,刚才安装的libmcrypt没有指定/usr/lib

[root@localhost mcrypt-2.6.8]# export LD_LIBRARY_PATH=/usr/local/bin:LD_LIBRARY_PATH
[root@localhost mcrypt-2.6.8]# ./cofigure && make && make install


mcrypt 安装完成
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  centos webservice php lnmp