Skip to main content

PHP7 Per Directory?

Comments

10 comments

  • JacobPerkins
    Hi, In the MultiPHP Manager in cPanel, simply set the directory that you want to run PHP70, and change it over.
    0
  • celiac101
    I just went into the MultiPHP Manager and do not see any way to add a directory/path. I do see per domain, but not per directory. Sorry, but more details would be helpful.
    0
  • JacobPerkins
    Hi, If the directory doesn't have an associated document root, you can copy the .htaccess AddHandler that we add and place it in the .htaccess file of the directory you're wanting to change. The UI's don't support per-directory, but the handlers will, no problem.
    0
  • celiac101
    If you mean that I should be able to add the code below to that directory's .htaccess file, I tried this and it does not work. I got a "Site not working" error: # php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php70" package as the default "PHP" programming language. AddType application/x-httpd-ea-php70 .php .php7 .phtml # php -- END cPanel-generated handler, do not edit
    0
  • celiac101
    This also did not work, it just kept popping open a file download box: AddHandler application/x-httpd-php7 .php
    0
  • cPanelMichael
    I got a "Site not working" error:

    Hello, Could you let us know the full error message you noticed? Did you see a corresponding error message in /usr/local/apache/logs/error_log or within any individual error_log files in the corresponding directory? Also, can you confirm PHP 7.0 is installed on the system? Thank you.
    0
  • celiac101
    I do have PHP 7 installed (I did a ticket with you to upgrade from Easy Apache 3 to 4, and your team verified this), and this is the only thing I see in the error log: [Mon May 01 13:44:58.176827 2017] [include:warn] [pid 19874] [client xxx.xxx.xxx.xxx:65288] AH01374: mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed: /404.shtml, referer: mydomain.tld
    0
  • cPanelMichael
    Hello @celiac101, Feel free to open a support ticket if you'd like us to take a closer look and determine why the per-directory setting for the PHP version in your .htaccess file isn't working. Thank you.
    0
  • celiac101
    The issue turned out to be that mbstring was not installed for PHP7. This is how I installed it, and it fixed the issue: yum install ea-php70-php-mbstring.x86_64
    0
  • cPanelMichael
    The issue turned out to be that mbstring was not installed for PHP7. This is how I installed it, and it fixed the issue: yum install ea-php70-php-mbstring.x86_64

    I'm happy to see the issue is now solved. Thank you for updating us with the outcome.
    0

Please sign in to leave a comment.