Domain name creating a download file

SYSTEM INFORMATION
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

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/common.inc.php’;

$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?
Thanks!

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/common.inc.php'; $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.
Thanks!

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”.

Ok, I re-installed Ubuntu 20.04 on a different server and the download issue is not happening anymore. But, I’m getting a different problem:
A 403 Error now with the message “Forbidden You don’t have permission to access this resource.” when I open phpMyAdmin page. I don’t know why?
If I could use the default (built in) database importer, I will not need the phpMyAdmin that is giving me all these problems.
When I’m trying to import a database, using the default database importer, I’m getting this error “mysqlimport: Error: 1146, Table ‘xi_db.martis-9’ doesn’t exist, when using table: martis-9”
If I could get the default database importer to work, I will delete the phpMyAdmin app.
Thanks for helping!

As (temp) workaround if MYSQL / MARIADB and Virtualmin is ok could help adminer maybe.?
https://www.adminer.org/

Try using Webmin / Servers ⇾ MySQL Database Server to import/export databases.

The database must exist (or be created prior) for it to be imported, using Execute SQL / Run SQL from file tab.

Does this mean that I cannot import a database file, saved in a given directory, using “Execute SQL / Run SQL from file” tab? Thx!

How on earth do you interpret “Run SQL from file” to mean you can’t get it from a file?

OK, thank you for clarifying. I was confused with “database be created”.

There needs to be a database to import the dumped SQL into. The database is not the data.

You create a database. You run the SQL in the dump, to import the data into the empty database.

Correct to all you just said. That’s how I got the error. However, I will try to import it from Webmin, instead of from Virtualmin, and see if it will work. Will try that tonight and update you.
Thanks again!