Removing old PHP Version


I like to ask how Virtualmin deals with if I just delete php5 from my system. I still have some virtual servers active with php5. Is there a script I can use to automatically set them to php7?


I have the same question.

apologies if I pick up your question incorrectly.

on a recent server I installed Centos . it installs PHP 7 and 5.4. PHP 7 is the default though
for each domain you can use the PHP version to change to either 7 or 5.4

however, you have to modify your PHP scripts to handle mysqli differently to mysql (exceptions get thrown otherwise)

Follow these steps to remove php 5 and install php 7.2 as the default for webmin/virtualmin.

Install IUS repository
rpm -Uvh

Remove PHP default versions
yum remove php* rh-php*

Install the new PHP version
yum install php72u-cli php72u-common php72u-fpm php72u-gd php72u-imap php72u-mbstring php72u-mysqlnd php72u-pdo php72u-process php72u-xml php72u-xmlrpc php72u-opcache php72u-json php72u-zip php72u-pspell php72u-pecl-apcu php72u-pecl-memcached php72u-ioncube-loader

Please note that I installed some extensions that I needed, so you can just install that you need or just copy the extensios that were removed on the previous command and install here.

Then go to you Virtualmin page and Recheck the configurations

Here is the page of repository for all PHP7 extensions: