I have set 3 virtual hosts on an AWS Linux AMI instance, HTML files are working file but the PHP files are outputting plain text. Before I set up the vhosts I tested the PHP files and they were running fine.
I followed these instructions to install the LAMP stack on my instance: AWS Install LAMP
I have put the vhosts in the /etc/httpd/conf/httpd.conf file, and they look something like this:
<VirtualHost *:80>
ServerName domain1.com
DocumentRoot /var/www/html/domain1
<Directory /var/www/html/domain1>
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName domain2.com
DocumentRoot /var/www/html/domain2
<Directory /var/www/html/domain2>
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName domain3.com
DocumentRoot /var/www/html/domain3
<Directory /var/www/html/domain3>
AllowOverride All
</Directory>
</VirtualHost>
I tried adding this to httpd.conf
AddType application/x-httpd-php .php
but this makes turns the plain text PHP files into downloadable PHP files
Have I been missing something obvious all along?