Parse .html as PHP?
I would like my server to parse .html as PHP if I add AddHandler application/x-httpd-php .html to .htaccess. The server is running EasyApache 4. I tried adding each
application/x-httpd-php="php:/usr/bin/php"
and
application/x-httpd-php="php:/opt/cpanel/ea-php70/root/usr/bin/php-cgi"
separately to /etc/suphp.conf and restarted Apache, but neither worked.
How do I get my my server to parse .html as PHP if I add AddHandler application/x-httpd-php .html to the .htaccess file?
-
Hello, Thanks for reaching out. You are very close in your syntax for adding this handler. When using EasyApache4, the handler type changes so that instead of application/x-httpd-php, the line needs to match x-httpd-ea-phpxx, where x is the minor and major version of php. So to have php 7.0 from EasyApache4 used, you can use this code in the .htaccess file for a vhost: AddType application/x-httpd-ea-php70 .php .php5 .html 0 -
Yes, I have tried that line, and it works, but my question is: How do I get my my server to parse .html as PHP if I add AddHandler application/x-httpd-php .html to the .htaccess file? 0 -
How do I get my my server to parse .html as PHP if I add AddHandler application/x-httpd-php .html to the .htaccess file?
Hello, Could you elaborate a little more on this question? For instance, is there any reason you prefer this line over the supported .htaccess entry referenced in the earlier post? Thank you.0
Please sign in to leave a comment.
Comments
3 comments