Addhandler php html

  • Re;


    So you must add


    Code
    1. AddHandler .html php5


    But for this thing to work, you must allow usage of the directive in the .htaccess files.


    By default we have in the vhost:


    Code
    1. AllowOverride AuthConfig Indexes Limit Options=Indexes \ Fileinfo=RewriteEngine,RewriteOptions,RewriteBase,RewriteCond,RewriteRule


    Try to change it to


    Code
    1. AllowOverride AuthConfig Indexes Limit Options=Indexes \
    2. Fileinfo=AddHandler,RewriteEngine,RewriteOptions,RewriteBase,RewriteCond,RewriteRule


    The modification for fpm is still valid. Don't forget to restart all services (apache, fpm). And remove also the AddType ... which you previously added.



    Refs: http://httpd.apache.org/docs/2…/mod_mime.html#addhandler

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Sorry for the late answer. Today I started to modified the files to see if it's working or not. Well, I encounter a small problem with the Apache2 vhost files. The server is running on an Ubuntu 14.04 witch comes with Apache/2.4.7.
    On this version of Apache2 things are a bit different than Apache 2.2.x from your example, one of the reason that I can't find,


    Code
    1. AllowOverride AuthConfig Indexes Limit Options=Indexes \
    2. Fileinfo=RewriteEngine,RewriteOptions,RewriteBase,RewriteCond,RewriteRule
  • @Delta04


    Sorry, it's my mistake. You should have AllowOverride All. The previous statement is only added when PHP is disabled ;)



    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Ok, I did all that and no change. Apache had already in the domain vhost " AllowOverride All ". In root dir of web server, inside .htaccess I did insert " AddHandler .html php5 ". I have added also .html in /etc/php5/fpm/pool.d/ domain.tld.conf.... Did I missed something?

  • Hi,


    for me this solution works


    I've modified the fpm pool as said by Nuxwin


    Code
    1. security.limit_extensions = .php .php5 .html .htm


    and edited the .htaccess with


    Code
    1. AddHandler php5-fcgi .html .htm


    With this mod, you must to disable the php permission editing for the user, because, if they make a change, the pool will restored without the security limit setting


    service php5-fpm restart


    And now the .html file can run the php code included


    Bye bye