一、下载需要的安装包,命令:wget http:/dl.wdlinux.cn/files/lamp_v3.tar.gz
二、解压下载下来的安装包,命令: tar zxvf lanmp_v3.tar.gz
三、执行安装,命令 sh lanmp.sh
四、
grep:/etc/redhat-release: 没有那个文件或目录
grep:/etc/redhat-release: 没有那个文件或目录
Select Install
1 LAMP (apache + php + mysql + zend + pureftpd +phpmyadmin)
2 LNMP (nginx + php + mysql + zend + pureftpd +phpmyadmin)
3 LNAMP (nginx + apache + php + mysql + zend + pureftpd +phpmyadmin)
4 install all service
5 don't install is now
Please Input1,2,3,4,5: #此时选择要安装的环境即可,一共有5个选项按照需求选择即可!
可能的错误:
执行sh lanmp.sh时运行报错,原因:系统的dash兼容性不好,而编译常用的就是dash。
具体错误:执行命令后显示以下信息
lanmp.sh:49: lib/common.conf: function: not found
lanmp.sh:76: lib/common.conf: Syntax error: "}"unexpected
解决方法:
命令:sudo dpkg-reconfigure dash #运行此命令,弹出弹窗时选择NO,即可解决报错
再次执行第三步即可解决。
可能错误:
lib/mysql.sh: line 13: cmake: command not found
解决方法:
安装cmake:apt install cmake
可能错误:
错误提示:./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library. You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=<path> options.
我的解决方法:
重新安装了OpenSSL(
参考:https://www.cnblogs.com/yxy666/p/9606286.html
)
可能错误:
src/core/ngx_murmurhash.c: In function ‘ngx_murmur_hash2’:
src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[2] << 16;^~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
case 2:
^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[1] << 8;^~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
case 1:
^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:473: objs/src/core/ngx_murmurhash.o] Error 1
make[1]: Leaving directory ‘/root/nginx-1.10.1‘
make: *** [Makefile:8: build] Error 2
解决方法;
原因:将警告当成错误处理
解决错误1:进入到nginx目录下(解压的目录)
找到当前目录下找到objs文件夹,并进入,打开文件Makefile,找到有一下内容的这行:
-Werror: gcc将所有的警告当成错误进行处理.把这行内容中的 “-Werror”去掉.
Nginx目录下重新make。
出现另一个错误
src/os/unix/ngx_user.c: In function ‘ngx_libc_crypt’:
src/os/unix/ngx_user.c:36:7: error: ‘struct crypt_data’ has no member named ‘current_salt’
cd.current_salt[0] = ~salt[0];
^
make[1]: *** [objs/Makefile:774: objs/src/os/unix/ngx_user.o] Error 1
make[1]: Leaving directory ‘/root/nginx-1.10.1‘
make: *** [Makefile:8: build] Error 2
还是Nginx目录下
命令:vim src/os/unix/ngx_user.c
把cd.current_salt[0]=~salt[0];用/* */注释掉