Skip to main content

Use common php handler?

Comments

6 comments

  • cPRex Jurassic Moderator
    Hey hey! What do you have in the .htaccess file for that domain? It should be something similar to this: AddType application/x-httpd-ea-php80 .php .php5 .html
    For security reasons, it's generally best not to do this for the risk of exposing your PHP code to the world, but I understand that sometimes it is not an option.
    0
  • Scott Galambos
    I have this: AddHandler application/x-httpd-ea-php81 .php .php8 .phtml .html But cPanel is then adding this at the bottom: # php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php81" package as the default "PHP" programming language. AddHandler application/x-httpd-ea-php81 .php .php8 .phtml # php -- END cPanel-generated handler, do not edit It parses .html file, I just don't want it done with CGI as shown. Or I want everything to be CGI, I just want it consistent.
    0
  • Scott Galambos
    If I disabled php-fpm and enable CGI it becomes common for both. but suphp/cgi is not as good. so I guess the question is - how do I get .html to be parsed by php-fpm instead of CGI?
    0
  • cPRex Jurassic Moderator
    Thanks for the additional details. This has to do with the way that PHP-FPM handles files, as we proxy the requests to that handler in a specific way. Here's the block from the Apache configuration showing this: SetHandler proxy:unix:/opt/cpanel/ea-php81/root/usr/var/run/php-fpm/1ed179754201ac2644e8c70140bacb23c7786484.sock|fcgi://cptest.tld
    So with PHP-FPM enabled, the handlers will show up differently, which is expected, but can't really be changed.
    0
  • Scott Galambos
    Thanks for the additional details. This has to do with the way that PHP-FPM handles files, as we proxy the requests to that handler in a specific way. Here's the block from the Apache configuration showing this: SetHandler proxy:unix:/opt/cpanel/ea-php81/root/usr/var/run/php-fpm/1ed179754201ac2644e8c70140bacb23c7786484.sock|fcgi://cptest.tld
    So with PHP-FPM enabled, the handlers will show up differently, which is expected, but can't really be changed.

    Well, can't I just append html to the FilesMatch? FilesMatch \.(phtml|html|php[0-9]*) ??
    0
  • cPRex Jurassic Moderator
    It wouldn't cost anything to try! But when I spoke with the developers on this they didn't bring up that option.
    0

Please sign in to leave a comment.