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 for PHP versions bundled by CloudLinux.

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

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

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


Add absolute path to PHP binaries into /etc/cl.selector/selector.conf using 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'


Execute cagefsctl --setup-cl-selector


New version of PHP should be available now for selection in PHP Selector.