Php code in HTML files


Hi I created a static html site using easy engine.

The site is opening fine but there is php code

             <?php  $includeFile = file_get_contents("");  echo $includeFile; ?>

It is not showing the content. allow_url_include = On and allow_url_fopen = On

My domain.conf

server {server_name;

access_log   /var/log/nginx/;
error_log    /var/log/nginx/;

root /var/www/;
index index.html index.htm;

location / {
	try_files $uri $uri/ /index.html; 

include common/locations.conf;}

Any ideas?



If you need php then create php websit.

ee site create --php

Now you have to update your HTML website to PHP website using following command

ee site update --php



Thank you but still not working its not parsing the php in the html file



reload nginx service nginx reload

could you provide me output for ee site show

    server {server_name;

    access_log   /var/log/nginx/ rt_cache;
    error_log    /var/log/nginx/;

    root /var/www/;
    index index.html index.htm index.php;

    index index.php index.htm index.html;

    include common/php.conf;
    include common/locations.conf;}



Try restart services:

ee stack restart 

Also monitor website logs

ee site log


Weird still not working I read around and some say should add something like this to the conf file but tried that not working

location ~ \.htm$ { 
    root           html;
        fastcgi_index  index.htm;
        include        fastcgi.conf;


@wyamout, Have you tried any other PHP code? Can you check whether phpinfo works fine or not? Also make sure that your all file permissions are www-data:www-data


Hello @wyamout

It’s been a long time, and we haven’t heard from you. It looks like your issue is resolved.

I am closing this support topic for now. Feel free to create a new support topic if you have any queries further. :slight_smile: