Skip to main content

can't execute php in html since EA4 upgrade

Comments

5 comments

  • sparek-3
    This probably should be
    AddHandler application/x-httpd-ea-php56 .html
    But the better solution is to not use PHP code in .html files. .html files are not setup as a standard extension for PHP code. You are going to run into portability concerns later down the road if you continue to do this. There's a reason .php file extensions exist.
    0
  • cPanelMichael
    AddHandler application/x-httpd-php5 .html

    Hello, Yes, as mentioned in the previous post, try using the following line instead:
    AddHandler application/x-httpd-ea-php56 .html
    Note that "php56" should reflect the version of PHP utilized for the account. Thank you.
    0
  • sh4ka
    Is there any way to setup this PHP execution in HTML globally for the entire Apache server? Thanks
    0
  • cPanelMichael
    Is there any way to setup this PHP execution in HTML globally for the entire Apache server? Thanks

    Hello, You should be able to complete the following steps to customize the default "" statement: 1. Copy the Apache 2.4 template for EasyApache 4 to allow for customization:
    cp -a /var/cpanel/templates/apache2_4/ea4_main.default /var/cpanel/templates/apache2_4/ea4_main.local
    2. Edit /var/cpanel/templates/apache2_4/ea4_main.local to change the entries to match your preferences:
    vi /var/cpanel/templates/apache2_4/ea4_main.local
    3. Save the changes, and then run:
    /scripts/rebuildhttpdconf
    Let us know if this helps. Thank you.
    0
  • sh4ka
    Thanks, will try that and let you know.
    0

Please sign in to leave a comment.