Roll your own PHP

Navigation:  PHP Selector >

Roll your own PHP

Previous pageReturn to chapter overviewNext page

To add your own PHP version in PHP Selector:


Create directory in /opt/alt (like: /opt/alt/php51), and mimic directory structure inside to be similar to the one of PHP versions bundled by CloudLinux.


Put all the ini files for all the modules into /opt/alt/php51/etc/php.d.all


Create a symbolic link /opt/alt/php51/etc/php.d -> /etc/cl.php.d/alt-php51


Place all such files into /opt/alt/php51/usr/lib/php/modules


Add an absolute path to PHP binaries into /etc/cl.selector/selector.conf using the following format:


php     5.1 5.1.2 /opt/alt/php51/usr/bin/php-cgi

php-cli 5.1 5.1.2 /opt/alt/php51/usr/bin/php

php-fpm 5.1 5.1.2 /opt/alt/php51/usr/sbin/php-fpm

  ^     ^    ^                ^----- absolute path

  |     |    |---------------------- real version

  |     | -------------------------- version to display

  |--------------------------------- binary to 'substitute'




cagefsctl --setup-cl-selector


The new PHP version must be available now for selection in PHP Selector.