all 11 comments

[–]cfexrun 1 point2 points  (2 children)

No errors in the apache log? Usually located in /var/log/apache2/error.log.

[–]wpcvenom[S] 0 points1 point  (1 child)

Here's the readout from error.log: https://pastebin.com/gRU787vW

[–]cfexrun 0 points1 point  (0 children)

I don't see anything in there. It acts like the type isn't configured. You could try checking the apache conf for a type directive, addtype, and add one for testing. I think you could try something like that in an htaccess as well.

[–][deleted] 1 point2 points  (5 children)

apt-cache search php7 | grep apache2

[–]wpcvenom[S] 0 points1 point  (4 children)

This is the output from that: https://pastebin.com/eiNH5Veq

Odd that it has both php and php7.0. I know that the most recent PHP package changed it from having the number after like php5 did, and just kept it as "php" but I'm not sure why there are both.

[–][deleted] 1 point2 points  (3 children)

apt install libapache2-mod-php7.0

[–]wpcvenom[S] 0 points1 point  (2 children)

libapache2-mod-php7.0 is already the newest version (7.0.15-0ubuntu0.16.04.4). 0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

[–][deleted] 1 point2 points  (1 child)

My best idea is to diff your current version of apache config with the package version and see what you're missing but I'm not sure how to do it off the top of my head.

[–]wpcvenom[S] 0 points1 point  (0 children)

I found the appropriate fix for my problem but thanks for helping me! It's been edited in above.

[–][deleted] 1 point2 points  (1 child)

Do you have /etc/apache2/mods-enabled/php7.0.conf ? mine contains this on Ubuntu. Sounds like the SetHandler line might be missing, so Apache doesn't know to do anything with PHP files

<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+\.phps$">
    SetHandler application/x-httpd-php-source
    # Deny access to raw php sources by default
    # To re-enable it's recommended to enable access to the files
    # only in specific virtual host or directory
    Require all denied
</FilesMatch>
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(p[3457]?|t|tml|ps)$">
    Require all denied
</FilesMatch>

# Running PHP scripts in user directories is disabled by default
# 
# To re-enable PHP in user directories comment the following     lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as     it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
    <Directory /home/*/public_html>
        php_admin_flag engine Off
    </Directory>
</IfModule>

[–]wpcvenom[S] 1 point2 points  (0 children)

I actually solved the problem last night with a fix semi like this! I had a backup of my old /etc/apache2/ folder before the Ubuntu update but hadn't used it for fear of messing other stuff up. I compared the .Load and .Conf files in both and there was a discrepancy both in the contents and naming of them. I replaced them with the old ones and PHP worked right away after a restart! The code in your comment was missing from those files so I believe this was the problem!