什么是LNMP一键安装包?LNMP一键安装包采用LinuxShell编写,可用于CentOS/RHEL/Fedora/Aliyun/Amazon、Debian/Ubuntu/Raspbian/Deepin/MintLinuxVPS或独立主机安装LNMP的Shell程序(Nginx/MySQL/PHP),LNMPA(Nginx/MySQL/PHP/Apache),LAMP(Apache/MySQL/PHP)生产环境。如果您想了解LNMP,请访问官网LNMP.org。由于官网默认安装不编译IMAP模块,本教程将指导如何在开始安装前添加IMAP模块的编译命令。本教程适用于Ubuntu18.04或centos71。进入分屏窗口,这样即使终端断开也不会中断编译安装。屏幕-Slnmp2。下载lnmp1.7的shell命令安装包,然后解压到文件夹中。wgethttp://soft.vpser.net/lnmp/lnmp1.7beta.tar.gz-cOlnmp1.7.ta??r.gz&&tarzxflnmp1.7.ta??r.gz&&cdlnmp1.73。进入php的shell安装文件夹编辑php自动安装文件,这样php编译可以加入IMAP模块支持。cdincludevimphp.sh4。找到下面的代码块,对应你需要安装的php版本。Install_PHP_73(){Echo_Blue"[+]安装${Php_Ver}"Tarj_Cd${Php_Ver}.tar.bz2${Php_Ver}if["${Stack}"="lnmp"];然后./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-config-file-scan-dir=/usr/local/php/conf.d--enable-fpm--with-fpm-user=www--with-fpm-group=www--enable-mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization${with_curl}--enable-mbregex--enable-mbstring--enable-intl--enable-pcntl--enable-ftp--with-gd${with_openssl}--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--without-libzip--enable-soap--with-gettext${with_fileinfo}--enable-opcache--with-xsl--enable-imap--with-imap--with-imap-ssl--with-kerberos${PHP_Modules_Options}else./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-config-file-scan-dir=/usr/local/php/conf.d--with-apxs2=/usr/local/apache/bin/apxs--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization${with_curl}--enable-mbregex--enable-mbstring--enable-intl--enable-pcntl--enable-ftp--with-gd${with_openssl}--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--without-libzip--enable-soap--with-gettext${with_fileinfo}--enable-opcache--with-xsl--enable-imap--with-imap--with-imap-ssl--with-kerberos${PHP_Modules_Options}5.这里我们安装的是php7.3版本,所以找到Install_PHP_73(),在if和else中的两个编译参数末尾添加如下参数,(这里,p注意在最后一个之前插入${PHP_Modules_Options})--enable-imap--with-imap--with-imap-ssl--with-kerberos6.完成后的代码如下:Install_PHP_73(){Echo_Blue"[+]Installing${Php_Ver}"Tarj_Cd${Php_Ver}.tar.bz2${Php_Ver}如果["${Stack}"="lnmp"];然后./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-config-file-scan-dir=/usr/local/php/conf.d--enable-fpm--with-fpm-user=www--with-fpm-group=www--enable-mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization${with_curl}--enable-mbregex--enable-mbstring--enable-intl--enable-pcntl--enable-ftp--with-gd${with_openssl}--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--without-libzip--enable-soap--with-gettext${with_fileinfo}--enable-opcache--with-xsl--enable-imap--with-imap--with-imap-ssl--with-kerberos--enable-imap--with-imap--with-imap-ssl--with-kerberos${PHP_Modules_Options}else./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-config-file-scan-dir=/usr/local/php/conf.d--with-apxs2=/usr/local/apache/bin/apxs--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization${with_curl}--enable-mbregex--enable-mbstring--enable-intl--enable-pcntl--enable-ftp--with-gd${with_openssl}--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--without-libzip--enable-soap--with-gettext${with_fileinfo}--enable-opcache--with-xsl--enable-imap--with-imap--with-imap-ssl--with-kerberos--enable-imap--with-imap--with-imap-ssl--with-kerberos${PHP_Modules_Options}7、编辑完成后,按:x保存退出,即可回到上层文件夹,即lnmp1.7文件夹下,执行命令安装:。/安装。sh因为lnmp默认安装是没有IMAP模块的,这里是带IMAP模块的php安装,避免安装完成后编译安装IMAP模块的麻烦。如果需要添加安装其他模块,也可以使用此方法。其他安装步骤和命令详见lnmp.org官网
