如果你按照我下面提供的步骤一步一步的安装,保证你一定会成功搭建LNMP环境,必且中间不会有任何报错!
1.mysql nginx php 安装顺序
1.1准备工作:我们首先需要把LNMP需要用到的软件包都提前安装好,不然的话到时候编译安装的时候就会出一些错误,
安装主机具备编译程序源码的环境,他需要具备C语言、C++语言、Perl语言的编译器,以及各种常见的编译支持函数库程序。
由于软件包比较多,可能安装时间会有点长!
[root@localhost ~]# yum -y install gcc gcc-c++ automake autoconf libtool make openssl openssl-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel
freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel
glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel
e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl
openssl-devel mysql-server libaio-devel.x86_64
................................................................
perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7
perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-4.el7
perl-Storable.x86_64 0:2.45-3.el7 perl-Test-Harness.noarch 0:3.28-3.el7
perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Thread-Queue.noarch 0:3.02-2.el7
perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7
perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-294.el7_6
perl-macros.x86_64 4:5.16.3-294.el7_6 perl-parent.noarch 1:0.225-244.el7
perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7
perl-threads-shared.x86_64 0:1.43-6.el7 xz-devel.x86_64 0:5.2.2-1.el7
libselinux-python.x86_64 0:2.5-14.1.el7 libselinux-utils.x86_64 0:2.5-14.1.el7
libsepol.x86_64 0:2.5-10.el7 libss.x86_64 0:1.42.9-13.el7
libstdc++.x86_64 0:4.8.5-36.el7_6.2 nspr.x86_64 0:4.19.0-1.el7_5
nss.x86_64 0:3.36.0-7.1.el7_6 nss-pem.x86_64 0:1.0.3-5.el7_6.1
nss-softokn.x86_64 0:3.36.0-5.el7_5 nss-softokn-freebl.x86_64 0:3.36.0-5.el7_5
nss-sysinit.x86_64 0:3.36.0-7.1.el7_6 nss-tools.x86_64 0:3.36.0-7.1.el7_6
nss-util.x86_64 0:3.36.0-1.1.el7_6 openssl-libs.x86_64 1:1.0.2k-16.el7_6.1
Complete!
安装完成后我们可以看到这个complete就可以了!
1.2这里我们把所有需要的软件源码包文件都统一放在/usr/local/src,这些源码包很方便的在网上可以找到.如果找不到可以联系我我可以把打包好的文件发给你。。
[root@localhost src]# ls
cmake-2.8.11.2.tar.gz libgd-2.1.0.tar.gz zlib-1.2.8.tar.gz
Discuz_X3.2_SC_GBK.zip libmcrypt-2.5.8.tar.gz t1lib-5.1.2.tar.gz
freetype-2.5.3.tar.gz libpng-1.6.12.tar.gz openssl-1.0.1h.tar.gz tiff-4.0.3.tar.gz
jpegsrc.v9a.tar.gz libvpx-v1.3.0.tar.bz2 pcre-8.35.tar.gz yasm-1.2.0.tar.gz
2.安装mysql
2.1 下载mysql5.6
我们这里只安装mysql5.6版本,其他版本大同小异请自行研究。
[root@localhost src]# wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.42-linux-glibc2.12-x86_64.tar.gz
--2019-06-04 21:33:16-- http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.42-linux-glibc2.12-x86_64.tar.gz
Resolving mirrors.163.com (mirrors.163.com)... 59.111.0.251
Connecting to mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 328979165 (314M) [application/octet-stream]
Saving to: ‘mysql-5.6.42-linux-glibc2.12-x86_64.tar.gz.1’
100%[==============================================================================>] 328,979,165 6.50MB/s