1、添加源
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
2、安装php及扩展
sudo apt-get install php7.1 php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-xml php7.1-fpm
3、关闭原来的php7.0,在nginx配置/etc/nginx/sites-available中文件将php更改为php7.1
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
4、重启nginx
登陆发表评论