Create Custom PHP Directives
Overview
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 /etc/cpanel/ea4/phpini_directives
directory.
How to add a custom PHP directive
To add a custom PHP directive, perform the following steps:
-
Create the
/etc/cpanel/ea4/phpini_directives
directory if it does not already exist. -
Inside the directory, create a
.yaml
file that contains a hash of the directives that you wish to add inside the directives key.Important:The hash inside your.yaml
file’s directives key must use the same format as the/usr/local/cpanel/whostmgr/etc/phpini_directives.yaml
file.
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.yaml
file first, and then reads the files in the/etc/cpanel/ea4/phpini_directives
directory in ASCII order. It will use the first occurrence of any directive that it reads from a.yaml
file.