How to Update VestaCP from PHP 7.2 to 7.4 in Ubuntu

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
v-backup-user admin
dpkg --get-selections | grep -v deinstall | grep php7.2

—– Below line is a comment for you
—– Copy all those in a text editor and change 7.2 with 7.4 and remove all install and spaces

apt-get install php7.4 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-pspell php7.4-readline php7.4-soap php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-zip

// this above command include the packages I was using you have to use yours

a2dismod php7.2
a2enmod php7.4
/etc/init.d/php7.2-fpm stop
/etc/init.d/php7.4-fpm start

update-alternatives –config php

/etc/init.d/php7.4-fpm restart

service nginx restart

cd /etc/php/7.2/fpm/pool.d/
cp * /etc/php/7.4/fpm/pool.d/
vi /usr/local/vesta/conf/vesta.conf

change php-fpm to php7.4-fpm in WEB_BACKEND line

WEB_BACKEND='php7.4-fpm'

Method Two

php -v

sudo apt-get update

sudo apt install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt install php7.4

sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl

sudo a2dismod php7.2

sudo a2enmod php7.4

sudo systemctl restart apache2

sudo apt remove php7.2*

sudo apt autoremove

Leave a Comment

Your email address will not be published.

Scroll to Top