Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Tuesday, August 3rd at 3pm PST / 6pm EST. Learn more
  • GoDaddy Community
  • GoDaddy Website Builders
  • GoDaddy Website Builders

    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 

    enabling php in html .htaccess

    I am trying to put some php code into an html page. I've placed in my root directory a .htaccess file and added the php/.htm .html line. I have a simple php echo hello world in there that does not work. The wanted code is four php lines trying to put out the info in SESSIONS onto the page. Does godaddy support php in html? Lostlee

    5 REPLIES 5

    Hi @lostlee

    Yes, our hosting supports PHP in HTML. If it is not working for you, sounds like you might have a syntex error. 

    KayJay - GoDaddy | Community Moderator
    24/7 support available at

    <?php echo "hello";?>
    Zipcode : <?php echo $_SESSION['zip'];?> <br>
    State : <?php echo $_SESSION['st'];?> <br>
    District : <?php echo $_SESSION['dist'];?><br>
    Email : <?php echo $_SESSION['email'];?><br

    This is the code including the hello world test.

    Hi, Lostlee:

    Have you had your code work now?  I am having the same problem and appreciate it if you have a solution now.  Thanks!



    Same issue here. Tried adding many different combinations of stuff into the .htaccess file. inluding but definitely not limited to:


    Options +ExecCGI
    AddHandler fcgid-script .html
    FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html

    Honestly, at this point I'm just going with a different hosting company. It shouldn't be this hard to figure out how to run php inside your .html files.


    I'm also having this issue and GoDaddy chat support wasn't able to help me. They suggested I use .htaccess to configure PHP to parse .html files and I created/uploaded a .htaccess which contained:


    AddHandler x-httpd-php .html


    However, this still doesn't work.