1:安装php7.3
sudo apt update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.3-fpm
设置PHP7.3-fpm开机启动:
Systemctl enable php7.3-fpm
2:查看php版本
Php -v
PHP 7.3.19-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jun 12 2020 07:48:30) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
3:卸载PHP
sudo apt-get autoremove php7*
sudo find /etc -name "*php*" |xargs rm -rf
sudo apt purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
dpkg -l | grep php7*
执行完最后一步,返回空,则卸载成功
4:安装PHP7.3插件
这里以gd库为例:
apt-get install php7.3-gd
安装完成之后,重启nginx
Systemctl restart nginx
有好的建议,请在下方输入你的评论。