lnmp 编译安装
lnmp 通过一键安装包安装十分简单,但是为了更加熟悉,可以尝试通过编译源码安装,安装过程中,会遇到并解决很多问题,学习到更多内容。
Linux 系统准备
更新系统
安装之前,请确保系统已更新到最新,系统更新方法是:在terminal中输入1
2sudo apt-get update
sudo apt-get upgrade
安装 gcc 与 make
1 | sudo apt-get install upgrade |
安装 nginx
下载源码
http://nginx.org/en/download.html
1 | mkdir -p ~/user/person |
安装
1 | cd nginx-1.10.1/ |
解决报错
可能出现的错误:
1、./configure: error: the HTTP rewrite module requires the PCRE library.
解决方案:sudo apt-get install libpcre3 libpcre3-dev
2、./configure: error: SSL modules require the OpenSSL library.
解决方案:sudo apt-get install openssl libssl-dev
报错解决后,反复执行make,直到没有错误提示
安装 php
下载源码
http://www.php.net/downloads.php
1 | cd ~/user/person |
安装
1 | ./configure --prefix=/usr/local/php7 \ |
解决报错
报错:configure: error: xml2-config not found. Please check your libxml2 installation.”
解决方法:sudo apt-get install libxml2 libxml2-dev
报错:”Cannot find OpenSSL’s <evp.h>”
解决方法:sudo apt-get install libcurl4-openssl-dev pkg-config
报错:—with-gd “ configure: error: png.h not found.”
解决方法:sudo apt-get install libpng12-dev libjpeg-dev
报错:—with-mcrypt “configure: error: mcrypt.h not found. Please reinstall libmcrypt.”
解决方法:sudo apt-get install libmcrypt-dev
报错:call to undefined function imagecreatefromjpeg()
解决方法:sudo apt-get install libjpeg62-dev –with-jpeg-dir –with-png-dir
报错:configure error :Please reinstall the lib curl distribution -easy.h should be in
解决方法:sudo apt-get install libcurl4-gnutls-dev
报错:configure: error: jpeglib.h not found.
解决方法:# sudo apt-get install libjpeg-dev
报错:configure: error: png.h not found.
解决办法:# sudo apt-get install libpng-dev
报错解决后,反复执行make,直到没有错误提示
安装mariadb
下载源码
1 | sudo apt-get install git |
安装
1 | cd server |