Virtualmin not accepting correct php config file

OS type and version 22.04
Webmin version 1.994
Virtualmin version 7.1-1
Related packages SUGGESTED

virtualmin not accepting correct php config file. This is my domain name check screenshot


@Ilia @Joe Please check

I have no idea what you’re asking. What do you mean Virtualmin is not accepting it?


Please check the arrow in both screenshots.

The issue is php configure file is not correct with the domain name

What execution mode are you using?

This is clearly mod_php (Server API: Apache 2.0 Handler) based on your screenshot.

What happens if you choose FPM mode and click save?

Why does everybody keep installing mod_php!? We keep telling y’all to never do that, but every danged day we have a new problem caused by installing mod_php. (Installing mod_php creates a new configuration file that hijacks all PHP requests before the Virtualmin per VirtualHost configuration even kicks in, which breaks things in a variety of ways.)



I freshly installed ubuntu 22.04 then virtualmin then restore backup from ubuntu 20.04 and virtualmin

Because its package name is php or php73 or php7.3. This is irrational not to want to install it when you want PHP at your system. It should have been called php-mod or whatever. And calling to install php should actually install php-cli.

Although, it raises questions about how OP installed Virtualmin. Did you install it using beta version of install script? If so, what did you do afterwards? How did you end up installing php8.1 package?

Because as usual they all don’t follow the directions. They all think they need to “set up” their servers with everything first and THEN install Virtualmin.

It’s on just about every tutorial and video on the internet because they’re all written by people that want to sound like they know more than they actually do.


I use this script

First install ubuntu server 22.04 (minimal) then install virtualmin then restore backup taken from my old server after resorted then i use this command:

apt-get install libapache2-reload-perl curl libapache2-mod-php libapache2-mod-php8.1 php-bcmath php8.1-bcmath php8.1-bz2 php-ldap php-curl php8.1-curl php-geoip php-imagick php8.1-imagick php-imap php-gd php8.1-gd php8.1-imap php-intl php8.1-intl php-json php8.1-json php-mbstring php8.1-mbstring php-memcache php8.1-memcache php-memcached php8.1-memcached php-mime-type php-oauth php-parser php-pear php-readline php8.1-readline php-xml php8.1-xml php-yaml php-zip php8.1-curl php8.1-ldap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-xsl php8.1-zip php-redis php-tidy php8.1-tidy php-ssh2 php8.1-ssh2 php-gmp php8.1-apcu zip unzip brotli php8.1-bcmath php8.1-cgi php8.1-cli php8.1-common php-curl php8.1-dba php8.1-enchant php8.1-fpm php8.1-gd php8.1-imap php8.1-intl php8.1-ldap php8.1-mbstring php8.1-opcache php-imagick php-memcache php8.1-soap php8.1-tidy php8.1-xml php8.1-zip libapache2-mod-php8.1 imagemagick php-imagick libapache2-mod-php8.1 php8.1-mysql php8.1-fpm php8.1-gd php8.1-json php8.1-curl php8.1-zip php8.1-xml php8.1-mbstring php8.1-bz2 php8.1-intl php8.1-bcmath php8.1-gmp php8.1-ldap redis-server unzip wget lm-sensors python-is-python2 perl default-jre default-jdk openjdk-8-jdk haveged libhavege1 rrdtool librrds-perl smartmontools -y && sudo a2enmod rewrite headers info brotli buffer echo file_cache userdir socache_dbm socache_memcache session session_cookie macro ldap alias env dir mime cache cache_disk cache_socache expires ext_filter filter imagemap cgi cgid setenvif && systemctl restart apache2 && apt-get update && apt-get upgrade -y

I need extention because of wordpress and other cms.

I think this script and beta script are same. Ref:- Does virtualmin support Ubuntu 22.04 and rhel 9? - #7 by


I installed php extentions and other extentions after installed virtualmin and restored backup. I dont follow any youtube and other media to do this.

And you broke your system doing it.

Search “mod php” on this site. There are literally THOUSANDS of post of them telling everybody NOT to do that.

1 Like

I broked my server last week. when i was updated my server then reboot. its was ubuntu 20.04 with latest webmin and virtualmi. Then i decided to take backup then restored in ubuntu 22.04. yesterday i freshly installed ubuntu 22.04 then virtualmin then restored backup. backup was restored successfully but apache2 was not starting. same error (configuration failed)) i was get in ubuntu 20.04. Then yesterday i start figuring out where is the issue and found out the issue is not in apache2. the problem is in these lines of apache2 conf file.

SSLEngine on
SSLCertificateFile /home/helppost/ssl.cert
SSLCertificateKeyFile /home/helppost/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCACertificateFile /home/helppost/
IPCCommTimeout 31

then i replace these lines with original line

Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
SSLCertificateFile /home/helppost/ssl.combined
SSLCertificateKeyFile /home/helppost/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
IPCCommTimeout 31

After that apache2 start running.

Don’t change the subject. Start a new topic if you want to talk about SSL configuration.

You broke your PHP by installing mod_php. Don’t do that. Uninstall it and clean up whatever mess it led to in your VirtualHosts.


How to install php extensions? wordpress and its plugin require those extension to work properly

It has nothing to do with extensions. You installed mod_php. Do not do that.

I’ve never seen a Wordpress plugin that needed a php extension to properly operate. I’ve set up dozens of blogs, forums and 5 e-commerce sites and never once had to add anything to php going back to 7.1.