Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Configuring Multiple PHP Versions on Virtualmin

Rumi, January 30, 2026

Virtualmin allows the selection of different PHP versions and execution modes for each domain. The recommended execution mode is FPM, but CGI/FCGId is also available, enabling per-directory PHP version settings.

Installing additional PHP versions

On RHEL, Alma, Rocky, Oracle, CentOS Stream and Fedora Linux

Install Remi repository

. /etc/os-release && repo_dir=$([ "$ID" = "fedora" ] && echo "fedora" || echo "enterprise") && dnf -y install "https://rpms.remirepo.net/$repo_dir/remi-release-$(rpm -E %$ID).rpm" && dnf clean all

Install PHP packages

dnf install php81-php-{cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}

Replace php81 with the desired PHP version, e.g., php83. Check available PHP versions and extensions in the Remi Repository or use dnf search php.

On Debian

Enable Sury/PHP repository

apt-get -y install apt-transport-https lsb-release ca-certificates curl && curl -sSL -o /usr/share/keyrings/debsuryorg-archive-keyring.gpg https://packages.sury.org/php/apt.gpg && sh -c ‘echo “deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main” > /etc/apt/sources.list.d/sury-debian-php-$(lsb_release -sc).list’ && apt-get update

Install PHP packages

apt-get install php8.1-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}

Replace php8.1 with the desired version, e.g., php8.3. Check available PHP versions and extensions on the SURY website or via apt-cache search –names-only ^php.

On Ubuntu

Enable Ondrej/PHP repository

LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update

Install PHP packages

apt-get install php8.1-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}

Replace php8.1 with the specific version, e.g., php8.3. Check available PHP versions and extensions on the Ondrej PPA website or via apt-cache search –names-only ^php.

Installing additional PHP extensions

In order to add additional PHP extensions, for all PHP versions installed on the system, use the following command:

Debian and derivatives

for php in $(ls /etc/php); do sudo apt-get install -y “php$php-“{curl,intl}; done

EL systems

for php in $(scl list-collections 2>/dev/null | grep 'php' | sed 's/$/-php/') php; do for ext in curl intl; do sudo dnf -y install "${php}-${ext}"; done; done

A command above will install the curl and intl extensions for all PHP versions installed on the system. You can replace the names of the extensions with the ones you need to have installed.

Configuring default PHP version

After installing another PHP version:

Verify in Virtualmin: Log in, go to System Settings ⇾ Re-Check Configuration. Among other information, you should see available PHP versions and execution modes.

Set default PHP version: Configure the default version for new virtual servers in System Settings ⇾ Server Templates ⇾ PHP Options page. For specific virtual server, set the PHP version in Web Configuration ⇾ PHP Options page.

Administrations Application phpvirtualmin

Post navigation

Previous post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx openvpn pfsense php Postfix powerdns Proxmox RDP SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin Windows 10 XCP-NG zimbra

Topics

Recent Posts

  • Configuring Multiple PHP Versions on Virtualmin January 30, 2026
  • Deploy a Container TIG (Telegraf, InfluxDB and Grafana) Stack January 24, 2026
  • Resetting password of another Linux by mounting disk December 15, 2025
  • “অমুক মাছ কেটে দিনে দশ হাজার কামাচ্ছে”- এসব গল্প এখন অনেকেই শোনায় November 22, 2025
  • Proxmox VM with NAT using Host Server November 21, 2025
  • Torrent Download Script with Aria2C on Debian 12 using Command Line Interface November 7, 2025
  • Install phpsysinfo on Debain Linux November 7, 2025
  • Delete OpenVPN Access Server Logs November 1, 2025
  • Install Monitorix on CentOS 7 October 3, 2025
  • Configure Centos 7 with multiple ip in bridge mode br0 October 3, 2025

Archives

Top Posts & Pages

  • Configuring Multiple PHP Versions on Virtualmin
©2026 Bots! | WordPress Theme by SuperbThemes