I'm trying to enable the cpapi2 command, but I can't get it to work fully.
I created a file, cpapi2.cfg, in /etc/cagefs/conf.d containing the following:
comment=cPanel API v2
I then ran cpapi2 a regular user and the following was shown:
Utility to execute cPanel API calls
cpapi2 [options] [module] [uri-key=uri-value] [uri-key=uri-value] ....
Additional documentation is available at https://go.cpanel.net/api2docs
IMPORTANT: “uri-key” and “uri-value” represent URI-escaped strings.[*]
The serialization format to use for output.
The serialization format to use for input.
- key-value (default) - uri-key=uri-value pairs as arguments
- json - Read JSON from stdin (currently only supported for WHM API 1)
The user to run the API call as. REQUIRED when running “bin/apitool.pl” as root.
Prints this help text.
Can't locate Cpanel.pm in @INC (you may need to install the Cpanel module) (@INC contains: /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0 /opt/cpanel/perl5/526/site_lib/x86_64-linux-64int /opt/cpanel/perl5/526/site_lib) at /usr/local/cpanel/Cpanel/ApiInfo/UAPI.pm line 13.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/ApiInfo/UAPI.pm line 13.
Compilation failed in require at /usr/local/cpanel/Cpanel/Template/Plugin/API_Shell.pm line 12.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/Template/Plugin/API_Shell.pm line 12.
Compilation failed in require at bin/apitool.pl line 462.
Am I doing something wrong here? Any idea on how to get it working?
I'd appreciate some help! : )