The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTML files via PHP engine?

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

  1. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    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

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    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)
     
Loading...

Share This Page