Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

HTML files via PHP engine?

Discussion in 'General Discussion' started by doni49, Feb 24, 2007.

  1. doni49

    doni49 Well-Known Member

    Oct 4, 2006
    Likes Received:
    Trophy Points:
    I've got a strange issue going on and I don't know what to do about it. I'm using a hosting account (server info is quoted below--copy/pasted from CPanel). I've got my main domain and two add-on domains. I HAD all of them config'd to have all HTML files processed via the PHP engine. Last night, the main domain and one add-on domain stopped processing the PHP code that's in the HTML files but one of the add-on domains is still processing the PHP code.

    I could have sworn that I used either "Apache Handlers" or "MIME Type" on the CPanel to do this. But I can't get it to work now. When I created a file called phpinfo.php (with one line: <?php phpinfo(); ?>) and loaded it, it DID work. So the PHP engine IS working.

  2. Spiral

    Spiral BANNED

    Jun 24, 2005
    Likes Received:
    Trophy Points:
    If you are wanting to parse .HTML files as PHP scripts then you need to have
    the appropriate AddType command in your .htaccess file either in the root page
    of your site or in the folder where the .HTML files are located.

    IE: AddType application/x-httpd-php .html

    Note that the above only works if the server where your site is located is
    running PHP as a standard Apache module.

    If PHP is running as a CGI such as with phpSuExec or SuPHP then your
    adding PHP parsing of HTML files to your .htaccess file will not work!

    (Note: Your phpinfo() page will tell you if PHP is running as a CGI or Module)

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice