安装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