Requisites: mod_lsapi, PHP Selector and CageFS
Follow the steps below:
Enable liblsapi for the domain
/usr/bin/switch_mod_lsapi --enable-domain domain.com
Create the file /etc/container/php.handler
with handlers corresponding to each PHP version and restart Apache webserver.
For example, the commands for PHP versions 5.4 & 5.5 will be:
application/x-lsphp54 /opt/alt/php54/usr/bin/lsphp (For Version 5.4)
application/x-lsphp55 /opt/alt/php55/usr/bin/lsphp (For Version 5.5)
Now we can add the required PHP version’s handler entry in the Directory’s .htaccess
AddType application/x-lsphp54 .php
Note: Subdirectories use the same PHP version as that of parent directory. To use native PHP, remove AddType
entry from .htaccess
and lsapi
will not look up for custom PHP version.