2015年8月14日 星期五

ubuntu - Enable PHP in HTML or other files

1. Created a file : .htaccess on your folder.
2. Add below to .htaccess :

$vim .htaccess

AddType application/x-httpd-php .html .htm
3. Modify "apache2.conf".

$vim apache2.conf

AllowOverride None => AllowOverride All
4. Restart apache2.

$sudo service apache2 restart

Reference : http://www.bictor.com/2015/03/03/enable-php-in-html-or-other-files/