Substitute global php.ini for individual customer

Navigation:  PHP Selector > Configuration >

Substitute global php.ini for individual customer

Previous pageReturn to chapter overviewNext page

Sometimes you might want to have a single customer with a different php.ini, than the rest of your customers.

 

To do that, you will use custom.etc directory functionality:

 

1. Move default php.ini into /etc directory and create a symlink to it:

 

$ mv /usr/local/lib/php.ini /etc/php.ini
$ ln -fs /etc/php.ini /usr/local/lib/php.ini

 

2. Change path to php.ini in /etc/cl.selector/native.conf file to:

 

php.ini=/etc/php.ini

 

3. For each user that needs custom php.ini file, create directory /etc/cagefs/custom.etc/USER_NAME/php.ini.

For example if you want to create custom php.ini for USER1 and USER2 you would create files:

/etc/cagefs/custom.etc/USER1/php.ini

/etc/cagefs/custom.etc/USER2/php.ini

Create such files for each user that should have custom php.ini file

 

4.Execute:

 

$ cagefsctl --force-update

 

Notes:

1.Users will be able to override settings of those php.ini files (global or custom) via PHP Selector. if you want to prevent that, you should disable PHP Selector feature.

2.Even if PHP Selector is disabled, user can override php settings by using ini_set() php function in php script, or by "php -c" command line option.

3.If you modify anything in /etc/cagefs/custom.etc directory, you should execute

 

$ cagefsctl --update-etc

 

in order to apply changes to CageFS for all users or:

 

$ cagefsctl --update-etc user1 user2

 

to apply changes to CageFS for specific users.