CentOS 7 + PHP7 — php not rendering in browser

I have a clean install of apache/httpd and php7.1.0 running on CentOS 7.

When I execute from the command line:

httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Jun 27 2018 13:48:59

and

php -v

I get the expected response

PHP 7.1.22 (cli) (built: Sep 12 2018 07:22:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

enter image description here

But when I try to hit my phpinfo.php page, all I get is... literally outputted to the screen - can someone tell me what I'm missing, did I forget to enable a mod?


Solution 1:

Try installing mod_php or enabling it if you have already installed it. I have not work on centos 7 recently so dont know how to do that,simple google search should be ok.