安裝nginx
nginx sudo apt-get install nginx
sudo /etc/init.d/nginx start
,成功後顯示ok Starting nginx(via systemctl):nginx.service.sudo lsof -i:80
安裝php7.2版本
sudo apt-get install php7.2 php7.2-fpm
php -v
,顯示結果php 7.2.4-1+ubuntu18.04.1+deb.sury.org+1(cli)(built: Apr 5 2018 08:48:14)(NTS)Nginx與php-fpm集成
sudo apt install ctags vim-doc vim-scripts
在編輯文件以前,注意切換到root, sudo -i
vim /etc/nginx/sites-available/default
按下鍵盤上的Insert
就能夠編輯文件了php
#location ~ .php$ {mysql
# include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000;
#}nginx
location ~ .php$ {sql
include snippets/fastcgi-php.conf; # With php-fpm (or other unix sockets): fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}ubuntu
Esc
,並用鍵盤輸入 :wq
就能夠修改爲功了sudo -i
命令行 vim /etc/php/7.2/fpm/pool.d/www.conf
listen = /run/php/php7.2-fpm.sock
sudo /etc/init.d/nginx restart
還有 `sudo安裝mysql
在安裝mysql的過程當中,沒有提示輸入密碼,經過查詢mysql官網,輸入命令 mysql_secure_installation
設置密碼vim