安裝LANMP步驟(需要ROOT權限)2020版本以上的Linux kali需要百度參考修改權限得文章
root@kali:~# wget http://dl.wdlinux.cn/files/lanmp_v3.tar.gz #下載lanmp壓縮包文件
root@kali:~#tar xzvf lanmp_v3.tar.gz #執行解壓命
root@kali:~# sh lanmp.sh #運行報錯,原因:系統的dash兼容性不好,而編譯常用的就是dash
執行命令后如果提示以下信息:
lanmp.sh:49: lib/common.conf: function: not found
lanmp.sh:76: lib/common.conf: Syntax error: "}"unexpected
root@kali:~# sudo dpkg-reconfigure dash #運行此命令,彈出彈窗時選擇NO,即可解決報錯
root@kali:~# sh lanmp.sh #重新運行LANMP,成功
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個選項,這里我選擇的是1,輸入1后回車即可!
0x2 sh lanmp.sh安裝服務時遇到的各種報錯
問題一:報錯:cmake:未找到命令
問題:執行sh lanmp.sh命令后報錯
root@kali:~# sh lanmp.sh
lib/mysql.sh:行13: cmake:未找到命令
x86_64----Install Error: mysql configure err
問題一解決方法:
root@kali:~#wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2.tar.gz #下載文件
root@kali:~# tar xzvf cmake-3.13.2.tar.gz -C /usr/bin #解壓你想指定的目錄后面填寫目錄路徑就好 例如:-C /usr/bin
root@kali:~# /usr/bin/cmake-3.13.2 #進入指定目錄
root@kali:~#./bootstrap && make &&make install #安裝文件
root@kali:~# cmake -version #查看版本信息
cmake version3.13.2CMake suite maintained and supported by Kitware (kitware.com/cmake).
問題二報錯:configure: error: xml2-config not found. Please check your libxml2 installation.
root@kali:~# sh lanmp.sh
checking libxml2 install dir.../usr
checkingfor xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
x86_64----Install Error: php configure err
問題二解決方法:
root@kali:~# apt install libxml2
root@kali:~# apt install libxml2-dev
問題四報錯:configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/
root@kali:~#sh lanmp.sh
checkingfor cURL in defaultpath... not found
configure: error: Please reinstall the libcurl distribution-easy.h should bein /include/curl/x86_64----Install Error: php configure err
問題四解決方法:
root@kali:~# apt-getinstall curl
root@kali:~# apt-get install libcurl4-gnutls-dev
root@kali:~# apt-get install php-curl