Wednesday 26 August 2020

add more php version at webmin

Gilmon D. Bernal


Ubuntu 16.04 doesn’t offer newer versions of PHP than PHP v7.3 yet. We can get around this by adding ondrej/php PPA to the server. No matter which PHP version you’re planning to install, you should start by adding ondrej/php PPA to be able to use multiple PHP versions with Virtualmin and Nginx.

add-apt-repository ppa:ondrej/php

Update apt cache

apt update
apt install memcached php-memcache php-pear php-imagick php5.6-cgi php5.6-mysql php5.6-curl php5.6-gd php5.6-imap php5.6-mcrypt php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-mbstring php5.6-zip php5.6-cli
apt install memcached php-memcache php-pear php-imagick php7.1-cgi php7.1-mysql php7.1-curl php7.1-gd php7.1-imap php7.1-mcrypt php7.1-tidy php7.1-xmlrpc php7.1-xsl php7.1-mbstring php7.1-zip php7.1-cli
apt install memcached php-memcache php-pear php-imagick php7.2-cgi php7.2-mysql php7.2-curl php7.2-gd php7.2-imap php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-mbstring php7.2-zip php7.2-cli
apt-get install memcached php7.0-mysql php7.0-curl php7.0-gd php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php7.0-zip



Virtualmin will use latest available version of PHP for new virtual servers. Old virtual servers will not be affected by above commands. If you need a different version of PHP for existing virtual server, you can go to Virtualmin > Domain Name > Server Configuration > PHP Version and select the PHP version you want from the list.



Virtualmin > System Settings > Server Templates > Default Settings > PHP Options.


This command will display PHP versions available to you with paths,

update-alternatives --list php

Following command should change default php version to PHP 7.1.

update-alternatives --set php /usr/bin/php7.1

Change the path to PHP as your needs.