It’s very simple to mange PHP directives on a CloudLinux server as we’ve PHP selector on it. We already summarized this on the topic >> Introduction to CageFS and PHP Selector << We can simply manage this through cPanel >> Software/Services >> Select PHP Version.
Here I’m explaining the steps to enable/disable “Xcache” via cPanel for a particular account. The following directives must be there in “/etc/cl.selector/php.conf” file on the server to manage this feature via cPanel. Directives are:
xcache.cacher on/Off
xcache.size --value--
xcache.stat on/Off
Oops! those directives aren’t there on my cPanel. Yeah that means the above directive are missing in “/etc/cl.selector/php.conf” file.
Add the following directives in “/etc/cl.selector/php.conf.”
Directive = xcache.cacher
Default = On
Type = bool
Comment = Enable or disable opcode cacher. Not available if xcache.size is 0.
Directive = xcache.size
Default = 50M
Type = value
Range = 0 50M 100M
Comment = Total amount of memory used for opcode (*.php) caching. If set to 0 - opcode caching is disabled.
Directive = xcache.stat
Default = On
Type = bool
Comment = Do stat() to check if xcache setting updated.
That’s it. No need to restart any services. Go to cPanel and check!
Related:
1, The XCache – Simple way to install Xcache from source code.
2, CloudLinux installation.