Elementary OS安装PHP测试环境 lnmp一键安装包

作者:matrix 发布时间:2016 年 12 月 30 日 分类:零零星星

安装环境

2016-12-2202

按照ubuntu正常安装的时候却报错:
Lnmp Unable to get linux distribution name, or do NOT support the current di

原因是因为 /etc/issue 中记录的是linux发行版本:elementary OS Loki
lnmp脚本无法识别出为ubuntu的系统内核

修改main.sh文件

文件路径:/lnmp1.3/include/main.sh
搜索关键字Get_Dist_Name()查找该方法替换为一下内容:

Get_Dist_Name()
{
    if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
        DISTRO='CentOS'
        PM='yum'
    elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
        DISTRO='RHEL'
        PM='yum'
    elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then
        DISTRO='Aliyun'
        PM='yum'
    elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
        DISTRO='Fedora'
        PM='yum'
    elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
        DISTRO='Debian'
        PM='apt'
    elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
        DISTRO='Ubuntu'
        PM='apt'
    elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
        DISTRO='Raspbian'
        PM='apt'
    elif grep -Eqi "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
        DISTRO='Deepin'
        PM='apt'
    else
        DISTRO='Ubuntu'
        PM='apt'
    fi
    Get_OS_Bit
}

或者下载main.sh覆盖:http://pan.baidu.com/s/1hsyVSw8
然后再执行install.sh脚本安装就可以了

%e5%b1%8f%e5%b9%95%e6%88%aa%e5%9b%be-2016-12-22