I decided to enable virtual hosts on my Apache server, and chose to make it port-based.
First thing I did, of course, was RTM. I followed the instructions found her
the only thing that helped me after all tried add apache2.conf
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Your answer did not work for me.
For Ubuntu 12.04:
sudo a2enmod php5
sudo service apache2 restart
This did it.
source: https://help.ubuntu.com/community/ApacheMySQLPHP
Make sure the following line which loads the php module is not commented out -
LoadModule php5_module libexec/apache2/libphp5.so
This finally put me on the right path:
http://www.linuxquestions.org/questions/linux-server-73/php-not-working-on-one-vhost-but-works-on-all-others-851093/
Here's the solution:
In the <Directory>
section, I included these lines:
<IfModule sapi_apache2.c>
php_admin_flag engine on
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
</IfModule>
Or, a redacted copy/paste of the solution on my server:
<Directory "/var/www/vhosts/A2/httpdocs">
<IfModule sapi_apache2.c>
php_admin_flag engine on
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
</IfModule>
(Other configuration parameters)
</Directory>