最近在網上看了不少,關於各類ubuntu14.04配置最新nginx+php7.0+mysql5.7的環境配置,對於不少新手可能總會遇到那麼一兩點他們徹底不知道的,因此接下來所寫的環境配置徹底適合新手按照命令直接操做。因爲不少都有現成的因此我引用別人的一篇文章作詳細深刻的說明,與配置。以供新手使用。php
下載簽名密鑰html
wget http://nginx.org/keys/nginx_signing.key sudo apt-key add nginx_signing.key
添加nginx源python
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" >> /etc/apt/sources.list echo "deb-src http://nginx.org/packages/ubuntu/ trusty nginx" >> /etc/apt/sources.list
安裝nginxmysql
sudo apt-get update sudo apt-get install nginx
測試nginx是否安裝成功nginx
http://localhost/
添加源到ubuntu中sql
sudo apt-get install python-software-properties sudo add-apt-repository ppa:ondrej/php sudo apt-get update
安裝php7.0及php7.0-fpmubuntu
sudo apt-get install php7.0 sudo apt-get install php7.0-fpm
作簡單的配置修改php7
sudo vi /etc/php/7.0/fpm/php.ini #將cgi.fix_pathinfo=1這一行去掉註釋,將1改成0。curl
查看php版本測試
php -v
咱們將獲得以下代碼:
PHP 7.0.10-1+deb.sury.org~trusty+1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.10-1+deb.sury.org~trusty+1, Copyright (c) 1999-2016, by Zend Technologies
查看咱們安裝的php擴展
php -m
安裝php擴展及依賴環境
sudo apt-get install php7.0-cli php7.0-common php7.0-curl php7.0-gd php7.0-mysql libxml2 libxml2-dev build-essential openssl libssl-dev libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev libreadline6 libreadline6-dev libgd-dev libxslt-dev
下載apt文件
解壓更新安裝
下載的apt文件在Downloads裏面,首先要進入到該文件夾下面。
sudo dpkg -i mysql-apt-config_xx_all.deb sudo apt-get update sudo apt-get install mysql-server
感謝原文此木依南