Go to /usr/local/directadmin/custombuild/
2. Edit options.conf
3. Change below config to :
#PHP Settings
php1_release=7.2
php1_mode=php-fpm
php2_release=7.1
php2_mode=php-fpm
Proceed to compile the PHP version via :
./build php
4. In this guide, the new PHP version is PHP71, therefore we go to directory:
/usr/local/php71/etc/php-fpm.d
5. Edit Domain config, at the bottom of the config, change :
security.limit_extensions = .php .php5 .php71 .inc .phtml
6. After we compile new PHP, the main PHP-FPM config will change automatically, you can edit both PHP-FPM config so it use our previous configs :
/usr/local/php71/etc/php-fpm.conf/usr/local/php72/etc/php-fpm.conf
7. Make sure the PHP-FPM config is changed as below at the bottom of the config : (This example is for PHP 71, change the php version accordingly for each PHP version)
; Load all DA User configs
include=/usr/local/php71/etc/php-fpm.d/*.conf
8. Last step is, change the individual main HTTPD config to it’s PHP71 version’s socket.
<FilesMatch \.php$>
SetHandler"proxy:unix:/usr/local/php71/sockets/apio2ocon.sock|fcgi://localhost/"
</FilesMatch>
Make sure to change both HTTP and HTTPS.
9. Check httpd config before restarting the service :
httpd -t
10. If it returns OK, restart all below services :
killall -HUP httpd
systemctl restart php-fpm72
systemctl restart php-fpm71
11. To verify , create PHPINFO file in the domain root directory with content below :
<?php phpinfo(); ?>