Create Custom PHP Directives
Last modified: August 28, 2019
This document explains how to add custom PHP INI directives to your system’s PHP configuration. This ensures that you can manage them in the Editor Mode of WHM’s MultiPHP INI Editor interface (WHM >> Home >> Software >> MultiPHP INI Editor).
If your system requires extra PHP configuration, you may wish to create custom PHP directives. If you want the system to validate your custom directives, you must add them to the
How to add a custom PHP directive
To add a custom PHP directive, perform the following steps:
/etc/cpanel/ea4/phpini_directivesdirectory if it does not already exist.
Inside the directory, create a
.yamlfile that contains a hash of the directives that you wish to add inside the directives key.Important:The hash inside your
.yamlfile’s directives key must use the same format as the
Your file might resemble the following example:
- If your new directive already exists, the system ignores it.
- The system reads the
/usr/local/cpanel/whostmgr/etc/phpini_directives.yamlfile first, and then reads the files in the
/etc/cpanel/ea4/phpini_directivesdirectory in ASCII order. It will use the first occurrence of any directive that it reads from a