Apache or Nginx downloads the PHP files instead of executing them I tried Nginx and apache installs nothing works when restoring server of wordpress

Operating system: 20.04
OS version:

Apache or Nginx downloads the PHP files instead of executing them

I tried Nginx and apache installs nothing works when restoring server of wordpress.

sudo adduser kng

sudo adduser kng sudo

usermod -aG sudo kng

wget http://software.virtualmin.com/gpl/scripts/install.sh
sh ./install.sh --bundle LAMP #or lemp
sudo reboot

It’s a php configuration issue.
Re-run the virtualmin configuration check and tell us the result of that please.

Restarted and removed aditional volume of backup wordpress

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 981.33 MiB 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), 7.4 (mod_php)

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

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

PHP versions have changed to 7.4, 7.4 since last check. Regenerating any missing php.ini files.

Webalizer is installed.

Apache is configured to host SSL websites.

MySQL 8.0.22-0ubuntu0.20.04.3 is installed and running.

ProFTPD is installed.

Logrotate is installed.

SpamAssassin and Procmail are installed and configured for use.

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.

IPv6 addresses are available, using interface eth0.

Default IPv4 address for virtual servers is 165.227.175.71.

Default IPv6 address for virtual servers is fe80::3025:8ff:fe70:a9f2.

Quotas are not enabled on the filesystem / which contains home directories under /home and email files under /home. Quota editing has been disabled.

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.

Updating all Webmin users with new settings…
… done

Updating status collection job …
… done

Applying web server configuration …
… not running!

Re-loading Webmin …
… done

Sorry wrong sserver. I have 8 now opened.

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 981.33 MiB 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), 7.4 (mod_php)

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

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

Webalizer is installed.

Apache is configured to host SSL websites.

MySQL 8.0.22-0ubuntu0.20.04.3 is installed and running.

ProFTPD is installed.

Logrotate is installed.

SpamAssassin and Procmail are installed and configured for use.

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.

IPv6 addresses are available, using interface eth0.

Default IPv4 address for virtual servers is 165.227.175.71.

Default IPv6 address for virtual servers is fe80::3025:8ff:fe70:a9f2.

Quotas are not enabled on the filesystem / which contains home directories under /home and email files under /home. Quota editing has been disabled.

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.

Downloading http://wordpress.org/latest.zip (162 bytes) …
Downloading https://wordpress.org/latest.zip (15.76 MiB) …
Received 15.61 KiB (0 %)
Received 1.57 MiB (10 %)
Received 3.15 MiB (20 %)
Received 4.72 MiB (30 %)
Received 6.3 MiB (40 %)
Received 7.88 MiB (50 %)
Received 9.45 MiB (60 %)
Received 11.03 MiB (70 %)
Received 12.61 MiB (80 %)
Received 14.18 MiB (90 %)
Received 15.76 MiB (100 %)
… download complete.

PHP module gd is required …
Enabling module in PHP configuration …
… done
Installing package php-gd …
Installing package(s) with command apt-get -y -f install php-gd …
Reading package lists…
Building dependency tree…
Reading state information…
The following additional packages will be installed:
php7.4-gd
The following NEW packages will be installed:
php-gd php7.4-gd
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.0 kB of archives.
After this operation, 160 kB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu focal-updates/main amd64 php7.4-gd amd64 7.4.3-4ubuntu2.4 [28.0 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu focal/main amd64 php-gd all 2:7.4+75 [2000 B]
[master 8df1938] saving uncommitted changes in /etc prior to apt run
47 files changed, 2735 insertions(+), 12 deletions(-)
delete mode 100644 apache2/sites-available/Latvijai.lv.conf.lock
create mode 100644 apache2/sites-available/protesti.latvijai.lv.conf
create mode 100644 apache2/sites-available/protesti.latvijai.lv.conf.lock
create mode 120000 apache2/sites-enabled/protesti.latvijai.lv.conf
create mode 100644 awstats/awstats.protesti.latvijai.lv.conf
create mode 120000 awstats/awstats.www.protesti.latvijai.lv.conf
create mode 100644 webmin/htaccess-htpasswd/directories
create mode 100644 webmin/virtual-server/apache-restart.lock
create mode 100755 webmin/virtual-server/domains/16101154113361
create mode 100644 webmin/virtual-server/domains/16101154113361.lock
create mode 100644 webmin/virtual-server/everyone/16101154113361
create mode 100755 webmin/virtual-server/lookup-domain.pl
create mode 100755 webmin/virtual-server/procmail/16101154113361
create mode 120000 webmin/virtual-server/spam/16101154113361/65_debian.cf
create mode 120000 webmin/virtual-server/spam/16101154113361/init.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/local.cf
create mode 120000 webmin/virtual-server/spam/16101154113361/sa-compile.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/sa-update-hooks.d
create mode 120000 webmin/virtual-server/spam/16101154113361/v310.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/v312.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/v320.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/v330.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/v340.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/v341.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/v342.pre
create mode 120000 webmin/virtual-server/spam/16101154113361/v343.pre
create mode 100755 webmin/virtual-server/spam/16101154113361/virtualmin.cf
create mode 100755 webmin/virtualmin-awstats/awstats.pl
create mode 100644 webmin/virtualmin-awstats/runas
create mode 100644 webmin/webalizer/var_log_virtualmin_protesti.latvijai.lv_access_log.conf
create mode 100644 webmin/webalizer/var_log_virtualmin_protesti.latvijai.lv_access_log.log
create mode 100755 webmin/webalizer/webalizer.pl
Fetched 30.0 kB in 0s (193 kB/s)
Selecting previously unselected package php7.4-gd.
(Reading database …
(Reading database … 5%
(Reading database … 10%
(Reading database … 15%
(Reading database … 20%
(Reading database … 25%
(Reading database … 30%
(Reading database … 35%
(Reading database … 40%
(Reading database … 45%
(Reading database … 50%
(Reading database … 55%
(Reading database … 60%
(Reading database … 65%
(Reading database … 70%
(Reading database … 75%
(Reading database … 80%
(Reading database … 85%
(Reading database … 90%
(Reading database … 95%
(Reading database … 100%
(Reading database … 218103 files and directories currently installed.)
Preparing to unpack …/php7.4-gd_7.4.3-4ubuntu2.4_amd64.deb …
Unpacking php7.4-gd (7.4.3-4ubuntu2.4) …
Selecting previously unselected package php-gd.
Preparing to unpack …/php-gd_2%3a7.4+75_all.deb …
Unpacking php-gd (2:7.4+75) …
Setting up php7.4-gd (7.4.3-4ubuntu2.4) …

Creating config file /etc/php/7.4/mods-available/gd.ini with new version
Setting up php-gd (2:7.4+75) …
Processing triggers for php7.4-fpm (7.4.3-4ubuntu2.4) …
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.4) …
Processing triggers for php7.4-cgi (7.4.3-4ubuntu2.4) …
Processing triggers for php7.4-cli (7.4.3-4ubuntu2.4) …
[master 9daf62e] committing changes in /etc made by “apt-get -y -f install php-gd”
6 files changed, 8 insertions(+)
create mode 120000 php/7.4/apache2/conf.d/20-gd.ini
create mode 120000 php/7.4/cgi/conf.d/20-gd.ini
create mode 120000 php/7.4/cli/conf.d/20-gd.ini
create mode 120000 php/7.4/fpm/conf.d/20-gd.ini
create mode 100644 php/7.4/mods-available/gd.ini
… install complete.
… done
… PHP module gd is now available.
PHP module curl is recommended …
Enabling module in PHP configuration …
… done
Installing package php-curl …
Installing package(s) with command apt-get -y -f install php-curl …
Reading package lists…
Building dependency tree…
Reading state information…
The following additional packages will be installed:
php7.4-curl
The following NEW packages will be installed:
php-curl php7.4-curl
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 33.0 kB of archives.
After this operation, 148 kB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu focal-updates/main amd64 php7.4-curl amd64 7.4.3-4ubuntu2.4 [31.0 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu focal/main amd64 php-curl all 2:7.4+75 [2000 B]
Fetched 33.0 kB in 0s (173 kB/s)
Selecting previously unselected package php7.4-curl.
(Reading database …
(Reading database … 5%
(Reading database … 10%
(Reading database … 15%
(Reading database … 20%
(Reading database … 25%
(Reading database … 30%
(Reading database … 35%
(Reading database … 40%
(Reading database … 45%
(Reading database … 50%
(Reading database … 55%
(Reading database … 60%
(Reading database … 65%
(Reading database … 70%
(Reading database … 75%
(Reading database … 80%
(Reading database … 85%
(Reading database … 90%
(Reading database … 95%
(Reading database … 100%
(Reading database … 218115 files and directories currently installed.)
Preparing to unpack …/php7.4-curl_7.4.3-4ubuntu2.4_amd64.deb …
Unpacking php7.4-curl (7.4.3-4ubuntu2.4) …
Selecting previously unselected package php-curl.
Preparing to unpack …/php-curl_2%3a7.4+75_all.deb …
Unpacking php-curl (2:7.4+75) …
Setting up php7.4-curl (7.4.3-4ubuntu2.4) …

Creating config file /etc/php/7.4/mods-available/curl.ini with new version
Setting up php-curl (2:7.4+75) …
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.4) …
Processing triggers for php7.4-fpm (7.4.3-4ubuntu2.4) …
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Processing triggers for php7.4-cgi (7.4.3-4ubuntu2.4) …
Processing triggers for php7.4-cli (7.4.3-4ubuntu2.4) …
[master 4ed8716] committing changes in /etc made by “apt-get -y -f install php-curl”
6 files changed, 8 insertions(+)
create mode 120000 php/7.4/apache2/conf.d/20-curl.ini
create mode 120000 php/7.4/cgi/conf.d/20-curl.ini
create mode 120000 php/7.4/cli/conf.d/20-curl.ini
create mode 120000 php/7.4/fpm/conf.d/20-curl.ini
create mode 100644 php/7.4/mods-available/curl.ini
… install complete.
… done
… PHP module curl is now available.
Configuring webserver PHP settings …
… done
Applying web server configuration …
… not running!
Now installing WordPress version 5.5.3 …
WordPress initial installation complete. It can be completed at http://protesti.latvijai.lv/blog/wp-admin/install.php.
More information on using this script can be found at http://wordpress.org/.

… done
Applying web server configuration …
… not running!

Please do not mix the topic with other issues.
Which php version is used? Is it properly configured and are the entries in the vhost configurations are correct?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.