'Raspberry Pi with Wordpress: instead of opening config-page for WP a file is downloaded?

During quarantine, I am tinkering with my raspberry pi and I decided to use it to learn some wordpress-basics. Thus I ventured to this site and followed the tutorial. (I am German and I liked the tone of writing ;-) ) and followed the tutorial.

When they ask that one might install phpmyadmin I followed their link to this site, where I followed the tutorial to install aforesaid phpmyadmin. Then as the tutorial accidentally installed Apache (I failed at realising, as a coughing attack prevented me from reading properly :-D ) I uninstalled Apache after stopping the service:

 sudo service apache2 stop
 sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
 sudo apt-get autoremove

after this is whereis apache2 and removed all the locations with sudo rm -rf {all the directories}. Then I followed the tutorial for getting wordpress up and running again :-). This means I installed Mariadb and set a user up with a password.

Other than aforementioned slip, I followed the tutorial to the point, however I had to disable fastcgi in nginx-config for nginx to start. (?)

Finally, I did

sudo chown -R www-data: .

and hit my Pi's IP-adress, hoping to see the wordpress config-file: But when I do that and hit enter a file named "Download" is downloaded, with the following content:

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );

/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Can anyone tell me what happened? Do you need my nginx.conf or th. similar?

Any help would be appreciated! (I might as well set it up again - It's a pi not an important server :-D )



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source