运行PHP到*.html扩展名(mime类型)


Run PHP into *.html extension (mime type)

我有xampp和我有一个项目,扩展是*。html和php代码有我的localhost php不解释代码并将其显示为php,但我想运行为php代码ex:index . html

 <?php
      $seccion='inicio';
      require_once("idiomas.html");
      require_once("configurador.html");
      require_once("header_scripts_css.html");
    ?>
    <body class="clearfix">
      <header id="header">
        <?php require_once("header.html"); ?>
      </header>
      <?php require_once("slider.html"); ?>
      <div id="centro">
        <?php require_once("central.html");?>
      </div>
      <?php require_once("footer.html"); ?>

可以添加

AddType application/x-httpd-php .html

到你的.htaccess文件或者你可以修改apache mod-php5设置