Ubuntu 23.04
Apache2 ?
PHP 8.1.12
MariaDB Ver 15.1 Distrib 10.11.2-MariaDB
Vivaldi 6.2.3105.47 stable
I installed LAMP and everything went well, or at least I thought. If I try to access a php file with my browser I'm asked if I want to download the php file.
After researching I found some information on including this conf directive that will cure this: AddType application/x-httpd-php php. The recommendation is to add it to /etc/apache2/httpd.conf, which I did. I then checked apache2.conf to make sure httpd.conf is included. It wasn't specifically, but I'm guessing it's included with IncludeOptional conf-enabled/*.conf.
Still have the problem. I noticed when I tried to sudo apache2 --version terminal reports: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory.
I inspected /etc/apache2/envvars and this is the relevant code:
# for supporting multiple apache2 instances
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
else
SUFFIX=
fi
# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
# temporary state file location. This might be changed to /run in Wheezy+1
export APACHE_PID_FILE=/var/run/apache2$SUFFIX/apache2.pid
export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
The if statement doesn't look right to me. But everything else looks okay, but I really don't know.
Any ideas?