dnNick Posted September 10, 2023 Share Posted September 10, 2023 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? Quote Link to comment Share on other sites More sharing options...
requinix Posted September 10, 2023 Share Posted September 10, 2023 If you're using LAMP then everything should be set up for you. You don't need to tinker with any configuration to make PHP work. So undo the changes you made and get yourself back to the original setup that, at least, had Apache up and running. With that addressed, a quick question: what is the URL you see in your browser's address bar when you try to run one of your scripts? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.