Create Custom PHP Directives and Install a Jekyll Ruby Application on cPanel

This article explains how to create custom PHP INI directives for EasyApache 4 and how to install and deploy a Jekyll Ruby application on a cPanel server. It covers YAML directive creation, required system paths, Ruby and Jekyll installation, building the site, and deploying it to a public directory.

PHP DirectivesJekyll InstallationEasyApache 4

~3 min read · Updated Feb 21, 2026

1. Create Custom PHP Directives


Important: This feature only applies to systems running EasyApache 4.


If your system requires additional PHP configuration, you can create custom PHP INI directives. To ensure that WHM’s MultiPHP INI Editor (Editor Mode) recognizes and validates your custom directives, you must store them in:


/etc/cpanel/ea4/phpini_directives


1.1 How to Add a Custom PHP Directive


  • Create the directory above if it does not already exist.
  • Inside the directory, create a .yaml file.
  • Define your directives inside the directives key using the same structure as the system file.

Example YAML structure:


directives:
  directive_foo:
    changeable: PHP_INI_ALL
    default: foo
    multiple: 0
    note: '...'
    section: '...'
    type: string

  directive_bar:
    changeable: PHP_INI_PERDIR
    default: 1
    multiple: 0
    note: '...'
    deprecated: 5.4.0
    section: '...'
    type: boolean

Notes:

  • If the directive already exists, the system ignores it.
  • The system reads /usr/local/cpanel/whostmgr/etc/phpini_directives.yaml first, then reads files in /etc/cpanel/ea4/phpini_directives in ASCII order.
  • The first occurrence of a directive is the one used.



2. Install a Jekyll Ruby Application


Jekyll is a static site generator built on Ruby. This section explains how to install and deploy a Jekyll application on a cPanel server.


Warning: cPanel does not develop or support Jekyll. Only experienced system administrators should perform these steps.


You may perform all steps via SSH or through cPanel’s Terminal interface.


2.1 Pre‑Installation Requirements


Update RubyGems to the latest version:


source /opt/cpanel/ea-ruby27/enable && gem update --system

Ensure the following EasyApache 4 RPMs are installed:


  • ea-ruby27-mod_passenger
  • ea-ruby27-ruby-devel

To install them:


yum install ea-ruby27-mod_passenger ea-ruby27-ruby-devel

2.2 Install Bundler and Jekyll


Install the required Ruby gems as the root user:


scl enable ea-ruby27 'gem install bundler jekyll'

If you prefer not to use scl:


  • Log in as a cPanel user.
  • Add this line to your shell’s rc file (e.g., ~/.bashrc):

source /opt/cpanel/ea-ruby27/enable

Log out and back in, then run:


gem install bundler jekyll

2.3 Create Your Jekyll Website


To create a new Jekyll application:


scl enable ea-ruby27 'jekyll new hyde'

2.4 Build and Deploy the Application


Navigate to the /hyde directory and build the site:


scl enable ea-ruby27 'jekyll build --baseurl '/hyde' --destination ~/public_html/hyde'

Then visit your new site in a browser:


http://example.com/hyde


In this example, example.com represents your domain.




Conclusion


This guide helps you create custom PHP directives for EasyApache 4 and install a Jekyll Ruby application on a cPanel server. These tools provide powerful customization options for developers and system administrators.


Written & researched by Dr. Shahin Siami

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue