Domain name creating a download file

OS type and version: Ubuntu 18.04
Webmin version: 1.981
Virtualmin version: 6.17-3
Related products version: RECOMMENDED

For some reason, when I enter type the domain name, I get a downloaded file with a message. I installed PhpMyAdmin and when I clicked on the url to open it, I get the message below.

" <?php


use PhpMyAdmin\Routing;

if (! defined(‘ROOT_PATH’)) {
// phpcs:disable PSR1.Files.SideEffects
// phpcs:enable

global $route, $containerBuilder;

require_once ROOT_PATH . ‘libraries/’;

$dispatcher = Routing::getDispatcher();
Routing::callControllerForRoute($route, $dispatcher, $containerBuilder); "

Please advise on how to resolve this issue.
Thanks a lot!

This almost always happens because you installed mod_php. (This is in the php or php72-php, or similar, package.)

You should not install mod_php.

I installed php 7.4, needed for Moodle, with some extensions. How could I get php 7.4 without having this issue? Also, could you please share a solution to this or the command to uninstall mod_php? Or should I re-install a different version of Ubuntu which comes with php 7.4 already?

Well, I just installed Ubutu 20.04, which comes with php 7.4, and I’m getting the same issue.
this is the message on the download:

<?php declare(strict_types=1); use PhpMyAdmin\Routing; if (! defined('ROOT_PATH')) { // phpcs:disable PSR1.Files.SideEffects define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR); // phpcs:enable } global $route, $containerBuilder; require_once ROOT_PATH . 'libraries/'; $dispatcher = Routing::getDispatcher(); Routing::callControllerForRoute($route, $dispatcher, $containerBuilder);

Don’t install mod_php. I’ve already told you it is in the php package. Probably something like php74-php.

OK thanks! Now, where do I go to enable the php 74 so that It can show as an option under “PHP Options”?
Thanks again!

Re-check Configuration

Any link for the documentation on how to configure that please? Also, my PHP script execution mode us FCGId.

No, there is a menu item labeled “Re-check Configuration” in System Settings. Click that.

Below is what I get from clicking on "Re-check Configuration:

Checking Configuration

" The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active …

Your system has 7.77 GiB of memory, which is at or above the Virtualmin recommended minimum of 256 MiB.

BIND DNS server is installed, and the system is configured to use it.

Mail server Postfix is installed and configured.

Postfix is configured to support per-domain outgoing IP addresses.

Apache is installed.

The following PHP versions are available : 7.4.3 (/bin/php-cgi7.4)

The following PHP-FPM versions are available on this system : 7.4.3 (php7.4-fpm)

The following PHP execution modes are available : none cgi fcgid fpm

Webalizer is installed.

Apache is configured to host SSL websites.

MySQL 8.0.27-0ubuntu0.20.04.1 is installed and running.

ProFTPD is installed.

Logrotate is installed.

SpamAssassin and Procmail are installed and configured for use.

ClamAV is installed and assumed to be running.

Plugin AWstats reporting is installed OK.

Plugin DAV Login is installed OK.

Plugin Protected web directories is installed OK.

Using network interface eth0 for virtual IPs.

Default IPv4 address for virtual servers is (I removed the IP).

Both user and group quotas are enabled for home and email directories.

All commands needed to create and restore backups are installed.

The selected package management and update systems are installed OK.

Chroot jails are available on this system

… your system is ready for use by Virtualmin. "

Please advise if there is any issue here causing my problem.

Did you uninstall the default PHP version? Why?

Your domains are presumably trying to use a nonexistent PHP version.

I did not uninstall or install a PHP version. The PHP version here is the default version from Ubuntu 20.04.
Let me change the version of Ubuntu to 18.04 and resend you the “Re-check Configuration”.