The ea-cpanel-tools Package's Scripts
Last modified: September 13, 2024
Overview
The ea-cpanel-tools
package includes scripts that allow you to work with EasyApache 4 (EA4) from the command line rather than in WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4).
Create a new profile
The /usr/local/bin/ea_current_to_profile
script creates a new EasyApache 4 profile based on your current EasyApache 4 configuration.
To use this script, run the following command:
/usr/local/bin/ea_current_to_profile [options]
If you do not pass an argument to this script, it creates the profile in the etc/cpanel/ea4/profiles/custom
directory and names the file automatically. The script then adds it to the list of available custom profiles in the EasyApache 4 interface (WHM » Home » Software » EasyApache 4). The file’s name will resemble the following example:
current_state_at_2015-08-28_10:10:04.json
Script arguments
Option | Description | Example |
---|---|---|
--help |
Display a help message. | /usr/local/bin/ea_current_to_profile --help |
--output=profile_name |
Create a profile from EasyApache 4’s current configuration. In this option, profile_name represents the name of the profile file that you wish to create.
Important:
|
/usr/local/bin/ea_current_to_profile --output=/etc/cpanel/ea4/profiles/custom/myprofile.json |
--target-os=operating_system |
Create a profile from EasyApache 4’s current configuration that excludes any packages that are incompatible with the specified operating system. In this option, operating_system represents the specified operating system.
Warning:
This option is meant for internal use only.
|
/usr/local/bin/ea_current_to_profile --target-os=AlmaLinux8 |
Provision an EA4 profile
The /usr/local/bin/ea_install_profile
script provisions a profile from the command line.
To use this script, run the following command, including the full file path to the profile file:
/usr/local/bin/ea_install_profile [--install] profile_file
If you do not pass the --install
option, the system displays the changes it will make if you provision the profile before you install it. You must pass the --install
option to provision the profile.
Synchronize a user’s PHP configuration
The /usr/local/bin/ea_sync_user_phpini_settings
script synchronizes the php.ini
file in a user’s document root with the corresponding .user.ini
and .htaccess
files that also exist there. This ensures that the user’s PHP configuration behaves as expected.
Only the root
user can run this script.
To use this script, run the following command:
/usr/local/bin/ea_sync_user_phpini_settings [options]
Option | Description | Example |
---|---|---|
--help |
Displays a help message. | /usr/local/bin/ea_sync_user_phpini_settings --help |
--user=username |
Sync the specified user’s .ini files.
Note:
You can pass this option multiple times.
|
/usr/local/bin/ea_sync_user_phpini_settings --user=user1 --user-user2 |
--all-users |
Sync the .ini files for all users on the system. |
/usr/local/bin/ea_sync_user_phpini_settings --all-users |
Other tools
The ea-cpanel-tools
package also contains the following tools:
-
The
ea4-metainfo.json
file, which contains EasyApache 4’s default PHP version, PHP handler, and the packages shown in the Additional Packages section of the EasyApache 4 interface (WHM » Home » Software » EasyApache 4). -
The EasyApache 4 Recommendations system, which provides a variety of recommendations about the packages you can select.
-
The
ea_convert_php_ini
script, which converts a user’s existingphp.ini
file to one that EasyApache 4 can use if the user’s PHP version uses suPHP. This conversion happens during the EasyApache 3 to EasyApache 4 migration process.Warning:We strongly recommend that you do not manually execute this script.