Here is an easy instruction of how to setup different PHP versions per directories when using mod_lsapi.
Assuming that you already have CageFS, PHP Selector and mod_lsapi installed, perform the following steps:
1. Setup mod_lsapi (no matter globally or per domain).
2. If cPanel with EasyApache 3 used (other or no panel) - create /etc/container/php.handler file with handlers for different versions:
application/x-lsphp52 /opt/alt/php52/usr/bin/lsphp application/x-lsphp53 /opt/alt/php53/usr/bin/lsphp application/x-lsphp54 /opt/alt/php54/usr/bin/lsphp application/x-lsphp55 /opt/alt/php55/usr/bin/lsphp application/x-lsphp56 /opt/alt/php56/usr/bin/lsphp application/x-lsphp71 /opt/alt/php71/usr/bin/lsphp
Restart Apache. If EasyApache 4 used - you should already have a /etc/container/php.handler file with content inside:
application/x-httpd-ea-php44-lsphp /opt/cpanel/ea-php44/root/usr/bin/lsphp application/x-httpd-ea-php51-lsphp /opt/cpanel/ea-php51/root/usr/bin/lsphp application/x-httpd-ea-php52-lsphp /opt/cpanel/ea-php52/root/usr/bin/lsphp application/x-httpd-ea-php53-lsphp /opt/cpanel/ea-php53/root/usr/bin/lsphp application/x-httpd-ea-php54-lsphp /opt/cpanel/ea-php54/root/usr/bin/lsphp application/x-httpd-ea-php55-lsphp /opt/cpanel/ea-php55/root/usr/bin/lsphp application/x-httpd-ea-php56-lsphp /opt/cpanel/ea-php56/root/usr/bin/lsphp application/x-httpd-ea-php70-lsphp /opt/cpanel/ea-php70/root/usr/bin/lsphp application/x-httpd-ea-php71-lsphp /opt/cpanel/ea-php71/root/usr/bin/lsphp
3. Create .htaccess file in the desired directory where you want to have a different from default PHP version with right handler. For cPanel with EasyApache3 (other or no panel):
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$"> SetHandler application/x-lsphp71 </FilesMatch>
For cPanel with EasyApache4:
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$"> SetHandler application/x-httpd-ea-php71-lsphp </FilesMatch>
As a result, subdirectories will use the same PHP version as the parent unless you overwrite it with another .htaccess entry in that subdirectory.
To match PHP extensions selection with extensions selected by the end user for that PHP version in PHP Selector you have to follow http://docs.cloudlinux.com/index.html?php_extensions.html.
This way the main website can use native PHP handler (suphp/fcgi) while subdirectory is using lsapi with necessary PHP version.
Note! There is one little trick that can be confusing. It applies only if you have PHP Selector enabled and you have non-native version selected there for a user. In that case, if the version that you assign through .htaccess is the same as ea-php version selected as system default version in WHM -> MultiPHP Manager -> System Default version, that version will not be applies, the version that you'll actually get will be the same as selected in PHP Selector.