Finally, you probably may want to serve html files that embed php code in it. To do this, you need to edit /etc/apache2/mods-enabled/php5.conf file and add the following lines:<FilesMatch ".+\.html$"> SetHandler application/x-httpd-php</FilesMatch>

To reload the config file, restart the server:$ sudo service apache2 restart

You should see the following text if your server is properly configured:

HTML file with PHP Code

This code is run by PHP server

By the way, if you want to override the config setting with .htaccses file, you need to edit/etc/apache2/apache2.conf file and edit to<Directory /var/www/> Options FollowSymLinks AllowOverride All Require all granted</Directory>