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
Next 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 Proxmox RDP Softether SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin Windows 10 XCP-NG zimbra

Topics

Recent Posts

  • Youtube MP3 Downloader Script using AI February 14, 2026
  • Install Softether VPN and create a Destination NAT (D-NAT) Rule to access the private Client VPN Node on a Debian 12 OS February 14, 2026
  • Deploying Pulse Monitoring for Proxmox Cluster Ecosystem February 13, 2026
  • Technitium DNS Web UI Configuration for Primary-Secondary Name Servers February 12, 2026
  • Technitium DNS with Primary-Slave Installation on Debian February 12, 2026
  • Install Docker and Docker Compose in Debian 12 February 5, 2026
  • Install GUI on Debian 12 using CLI February 4, 2026
  • 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

Archives

Top Posts & Pages

  • Youtube MP3 Downloader Script using AI
©2026 Bots! | WordPress Theme by SuperbThemes