LAMP環境構築の際、Apacheによりブラウザにindex.phpを表示させようとすると、ソースコードが表示されたので解決した方法をメモ。
下記ファイルをエディタで編集。
sudo vi /etc/apache2/httpd.conf
下記コメントアウト(#)を外す。
#LoadModule php7_module libexec/apache2/libphp7.so
↓
LoadModule php7_module libexec/apache2/libphp7.so
無事PHPとしてブラウザ表示成功。