I've been trying to get PHP working locally on my machine in Fedora 26.
I have httpd installed, and that seems to be working. When I first had it set up, typing localhost in my browser showed me the HTML contents /var/www/html/index.html, but not the PHP contents. <?php  phpinfo(); ?> was not working, either.
I think PHP is also working, since php -r "phpinfo();" works in the command line.
I tried following the advice in this thread by adding AddType  application/x-httpd-php .php to my httpd.conf file, and this made my browser try to download the PHP files instead of displaying them. Weirdly, when I took this line back out and restarted httpd, my browser is still trying to download the files.
 
    