This article is about to set AddHandler properly in PHP. You can run .php file with apache. It may be necessary to execute other file extension with php parser like asp file with .asp extension. AddHandler comes handy in this case. Also if unsure of php version, you can add different php parser. Include this in .htaccess file of your project folder or in httpd.conf file.
To use PHP 5.4 as default:
1 2 3 4 5 | AddHandler application/x-httpd-php54 .php //To add other extension AddType application/x-httpd-php54 .html .htm .me .asp .newextension |
To use PHP 5.4 single php.ini
1 2 3 | AddHandler application/x-httpd-php54s .php |
1 2 3 | AddHandler fcgid54-script .php |
To use PHP 7.0
1 2 3 | AddHandler application/x-httpd-php70 .php |
Link: Secure your PHP applications with these tricks
Follow me: @sajjadrobin
or the Beard Guy: Robin The Beard Guy (RobinTBG)
Grow 100 twitter Followers in 24 hours