Configure Apache to use PHP
Install PHP via APT
apt install php[x.x]
Enable the Apache module
a2enmod phpX
Additionally, other PHP modules can be installed. Look at a list of available modules by running the following
apt-cache search php- | less
Tell Apache to server PHP files before other file extensions.
vim /etc/apache2/mods-available/dir.conf
Put index.php
at the beginning of the list of index files.
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
Reload Apache
systemctl reload apache2.service