How to configure Apache to process PHP code inside an .html file on a Plesk server

Follow

Comments

2 comments

  • Avatar
    Ilya Ladygin (Edited )

    on Plesk Obsidian Version 18.0.52 Update #3, nginx (proxy mode) + apache

    configured as above:

    in PHP settings

    [php-fpm-pool-settings]
    security.limit_extensions = .php .phar .html .inc

    in additional apache settings:

    <IfModule mod_proxy_fcgi.c>
      <Directory /var/www/vhosts/*******.net/httpdocs/*******.net>
        <Files ~ .(inc|html|htm)$>
          SetHandler proxy:unix:///var/www/vhosts/system/*******.net/php-fpm.sock|fcgi://127.0.0.1:9000
        </Files>
      </Directory>
    </IfModule>

    recieving "access denied" in browser.

    If "Sethandler ..." is commented out - page is loaded, but PHP not parsed.

     

    0
    Comment actions Permalink
  • Avatar
    Ilya Ladygin (Edited )

    i have found what was the problem - it was my mistake: i have configured a subdomain, PHP settings

    [php-fpm-pool-settings]
    security.limit_extensions = .php .phar .html .inc

    but path for socket-file php-fpm.sock was from main domain

    SetHandler "proxy:unix:///var/www/vhosts/system/*******.net/php-fpm.sock|fcgi://127.0.0.1:9000"
    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request