The ea-cpanel-tools Package Scripts
Last modified: April 18, 2022
Overview
This 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 profile based on your current EasyApache 4 configuration.
To use this script, run the following command:
/usr/local/bin/ea_current_to_profile [options]
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, which includes the path and extension, 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. This profile will exclude any packages that are not compatible with the specified operating system. In this option, operating-system represents the operating system you will install the profile on.
Important:
This option is meant for internal use only.
|
/usr/local/bin/ea_current_to_profile --target-os=AlmaLinux8 |
If you do not pass an argument, the script creates the profile in the etc/cpanel/ea4/profiles/custom
directory and names the file. 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
Provision an EA4 profile
The /usr/local/bin/ea_install_profile
script provisions a profile, but from the command line rather than the EasyApache 4 interface.
To use this script, run the following command:
/usr/local/bin/ea_install_profile [--install] profile_file
- You must pass the full path to the file that contains the profile.
- If you pass the
--install
option, the system provisions the profile on your system. - If you do not pass the
--install
option, the system displays the changes it will make if you provision the profile.
Synchronize a user’s PHP configuration
The /usr/local/bin/ea_sync_user_phpini_settings
script syncs the php.ini
file in a user’s document root with the corresponding .user.ini
and .htaccess
files that also exist in that document root. 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. For more information, read the EasyApache 4 Recommendations documentation.
-
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.
We strongly recommend that you do not manually execute this script.