In the ISPmanager5 control panel, you can install alternative versions of PHP to use them in different PHP modes by going to the section: "Settings → Features".
Alternative versions for CGI mode (as well as FastCGI Apache)
When an alternative version of PHP is installed, it becomes available for use in PHP mode as CGI (or FastCGI Apache if Apache Prefork is installed). In CGI mode, the PHP version can be different for each WWW domain of one control panel user. The setting applies to a single WWW domain
It is enough when editing WWW-domain to select required version from drop-down list.
Alternative versions for Apache module mode
When installing an alternate version, the administrator may also choose to use that version of PHP in Apache module mode
If this option is selected, the panel administrator will be able to specify which version of PHP should be used in Apache module mode in the PHP Versions list.
This setting applies to all WWW domains of all users using PHP in Apache module mode, i.e. the setting applies to the entire server.
Alternative versions for FastCGI mode (Nginx + PHP-FPM)
When installing an alternative version, the administrator can also choose to allow this version of PHP to be used in PHP-FPM module mode (a checkbox to grant this option is automatically selected)
If this option is selected, each user may select the desired PHP version to use in FastCGI mode (Nginx + PHP-FPM). Changing the setting is done from the "PHP versions" list on user level or on the user edit form from admin level.
Changes apply to all user WWW domains using PHP in FastCGI mode (Nginx + PHP-FPM).
After installation it will be possible to select alternative version of php for www-domain
Implementation features
When you change the version of PHP as an Apache module, the Apache web server is configured to use the module of the selected alternative version instead of the native version module.
When changing PHP versions for PHP-FPM, the user pool is configured for the correct version of the PHP-FPM service and the server may be running multiple PHP-FPM services of different versions, each serving a different set of users.
Example of adding your own builds to the panel
In order to add the ability to use your php packages, you need to create 2 files
/usr/local/mgr5/etc/xml/ispmgr_mod_myphp.xml
<?xml version="1.0" encoding="UTF-8"?>
<mgrdata>
<lang name="ru">
<messages name="feature">
<msg name="dname_altphp72">Alternate version of PHP 7.2
</msg> </messages>
<messages name="feature.edit">
<msg name="package_ispphp72">My PHP 7.2</msg>
<msg name="hint_package_ispphp72">Use PHP 7.2 in CGI mode
</msg>
<msg name="package_ispphp72_mod_apache">PHP module for Apache version 7.2
</msg>
<msg name="hint_package_ispphp72_mod_apache">Ability to use PHP 7.2 in Apache module mode
</msg>
<msg name="package_ispphp72_fpm">PHP 7.2 for PHP-FPM
</msg>
<msg name="hint_package_ispphp72_fpm">Ability to use PHP 7.2 with PHP-FPM
</msg>
<msg name="packagegroup_altphp72gr">PHP v.7.2
</msg>
<msg name="hint_packagegroup_altphp72gr">Ability to use PHP v7.2
</msg> </messages> </lang></mgrdata>
/usr/local/mgr5/etc/xml/ispmgr_features.d/my_php.xml
<?xml version="1.0" encoding="UTF-8"?>
<features>
<feature name="altphp72" featuregroup="altphp">
<packagegroup name="altphp72gr" type="select">
<package name="ispphp72" dispname="PHP 7.2 CGI" primary="yes" recommended="yes">
<systemname>isp-php72</systemname></package>
<if value="turn_off" hide="package_ispphp72_mod_apache" shadow="yes"/>
<if value="turn_off" hide="package_ispphp72_fpm" shadow="yes"/>
</packagegroup>
<package name="ispphp72_fpm" dispname="PHP 7.2 PHP-FPM" recommended="yes">
<systemname>isp-php72-fpm</systemname></package>
<package name="ispphp72_mod_apache" dispname="PHP 7.2 Apache module">
<systemname>isp-php72-mod-apache</systemname></package></feature></features>
<systemname>isp-php72</systemname> is the name of the package in apt\yum
<package name="ispphp72" dispname="PHP 7.2 CGI" primary="yes" recommended="yes">Describes the package for CGI mode
<package name="ispphp72_fpm" dispname="PHP 7.2 PHP-FPM" recommended="yes">Describes package for PHP-FPM mode
<package name="ispphp72_mod_apache" dispname="PHP 7.2 Apache module">Describes the package for the Apache module
You may omit the packages for PHP-FPM and Apache from the description if they are missing for some reason.
Then restart the panel
/usr/local/mgr5/sbin/mgrctl -m ispmgr exit
Your package (in this case the package will be called php47) should have a file in /opt/php47/etc/php.ini
More information can be found in official documentation