ubutnu16.04 安装nginx php7.0 mysql

  1. 安装nginx
sudo wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key

sudo vim /etc/apt/sources.list
Version Codename Supported Platforms
12.04 precise x86_64, i386
14.04 trusty x86_64, i386, aarch64/arm64
15.10 wily x86_64, i386
16.04 xenial x86_64, i386
deb http://nginx.org/packages/debian/ codename nginx
deb-src http://nginx.org/packages/debian/ codename nginx
deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx

sudo apt-get update
sudo apt-get install nginx

  1. 安装mysql
sudo apt-get install mysql-server

  1. 安装php7.0
sudo add-apt-repository ppa:ondrej/php
or
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php

sudo apt-get install php7.0 php7.0-cli php7.0-fpm php7.0-gd php7.0-json php7.0-mysql php7.0-readline

sudo apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php7.0-pear php7.0-imagick php7.0-imap php7.0-mcrypt php7.0-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php7.0-gettext php7.0-zip