环境介绍:
我php起初环境比较复杂,切换也不方便,我进行了php的重装
卸载:
#一、删除php的相关包及配置 sudo apt-get autoremove php* -y #二、删除关联 sudo find /etc -name "*php*" |xargs rm -rf #三、清除dept列表 sudo apt purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` -y #四、检查是否卸载干净(无返回就是卸载完成) dpkg -l | grep php
然后进行了php指定版本的安装
sudo apt-get update apt install software-properties-common add-apt-repository ppa:ondrej/php apt-get update apt -y install php7.4 apt-get -y install php7.4-fpm apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip} apt-get install -y curl libcurl4 libcurl4-openssl-dev php-curl
修改/etc/php/7.4/fpm/pool.d/www.conf中的端口
重启php即可
systemctl restart php7.4-fpm