web stats

Parsing PHP in HTML files using EA4, PHP 5.5 and up.

If you’re reading this then you’re in the same board as me. I had tried Googling and trying different directives in .htaccess file, I even went and edited the httpd.conf file which is the Apache configuration file in case you didn’t know. Nothing worked.

Finally I asked the Senior Admin and then solution was simple. Follow the instructions below.

Login to your website FTP.

Make a file called .htaccess in case it’s not there yet. Needs to be in root folder, such as /public_html/.htaccess

Add this:

If you’re using PHP 5.5

AddType application/x-httpd-ea-php55 .html .htm .php

If you’re using PHP 5.6

AddType application/x-httpd-ea-php56 .html .htm .php

If you’re using PHP 7.0

AddType application/x-httpd-ea-php70 .html .htm .php

If you’re using PHP 7.1

AddType application/x-httpd-ea-php71 .html .htm .php

Now, I haven’t tested this on PHP 7+ but I am assuming the directives would be the same.

This works on Apache EA4 Linux.  If you have any issues, use the comments below and I will help you out as best as I can.

 

Leave a Reply