Skip to main content

PHP Handler keeps reseting?

Comments

4 comments

  • cPRex Jurassic Moderator

    Hey there!  Can you let me know the specific code you're adding and where in the file you're adding that?  Are you just adding the ".html" text to the end of that line?

    If you could paste the entire .htaccess file so I could see specifically where you're making this change I may be able to get you better information.

    0
  • Scott Galambos

    I'm not really adding code, just ".html".  So here is a /home/user/www/.htaccess file that was set to use PHP 8.5 in PHP Multi Manager.  I then edited this file and added .html at the end so it was:
    AddHandler application/x-httpd-ea-php85 .php .php8 .phtml .html

    Then I come back the next day and .html is gone.  The .htaccess is now back to this:

    RewriteEngine on
    Options -Indexes

    # Disable all error logging via custom PHP
    <Files php.ini>
            order allow,deny
            deny from all
    </Files>

    # STUFF HERE

    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php85” package as the default “PHP” programming language.
    <IfModule mime_module>
      AddHandler application/x-httpd-ea-php85 .php .php8 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit

    0
  • cPRex Jurassic Moderator

    So there you go - that won't work because you can't edit anything in that block.  The best way to handle this for a specific site will be to use a custom Apache Handler as outlined here, which should be available in the specific cPanel interface.

    https://docs.cpanel.net/cpanel/advanced/apache-handlers/

    Like we found in https://support.cpanel.net/hc/en-us/community/posts/37757346098455-Automatically-add-html-to-PHP-handler I don't have a way to make this change global for all accounts by default.

    Is that something you'd like me to make a feature request for - allow a method to edit the default handler?

    0
  • Scott Galambos

    I guess I'll set the server default to PHP 8.5 and then it won't try to change it anymore. Thats what it does with with 8.1 when it is the default.  

    0

Please sign in to leave a comment.