1.進行更新 (具體文檔請聯系本部落客,首頁有部落客郵箱)
2.安裝MySQL
# 連續輸入兩次相同的密碼
3.安裝nginx和php
添加nginx和php的ppa源
4.安裝Nginx
5.安裝PHPFastCGI管理器
6.修改配置檔案(此步可以省略)
7.檢視 listen = /run/php/php7.0-fpm.sock 是否被開啟
一般為開啟
8.修改重新開機下 php-fpm7.0 (可以忽略)
9.修改nginx配置檔案
sudo vim /etc/nginx/sites-enabled/default
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html; 添加index.php
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ { 在此把#去掉
include snippets/fastcgi-php.conf; 在此把#去掉
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock; 在此把#去掉
} 在此把#去掉
本文轉自 技術花妞妞 51CTO部落格,原文連結:http://blog.51cto.com/xiaogongju/1940542