I am attempting to use the cPanel API 1 to access cPAddons as per cPanel API 1 Functions - cPAddons::mainpg - Software Development Kit - cPanel Documentation.
When running the example given against the user site1x..
..I receive this response:
It appears to be expecting parameters; however, no matter what I supply to it, I end up with the same HASH ref error.
In looking at the module file in question (/usr/local/cpanel/Cpanel/cPAddons.pm) it appears that any params passed to it are passed as a string and not as a hash; therefore, it errors out. I cannot figure out how to pass it the parameters in the format expected.
Any assistance would be appreciated! I eventually want to install the cPanel::Blogs::WordPress addon via the API, but I can't seem to get past step one yet.
When running the example given against the user site1x..
Code:
cpapi1 --user=site1x cPAddons mainpg
Code:
[2016-09-17 12:04:59 -0700] warn [Internal Warning while parsing unknown 25878] Can't use string ("") as a HASH ref while "strict refs" in use at /usr/local/cpanel/Cpanel/cPAddons.pm line 330.
...caught at cpanel.pl line 1790.
at cpanel.pl line 1790.
cpanel::cpanel::_api1("cPAddons", "cpaddons", "mainpg()", "mainpg", ARRAY(0x75bbff0), "none", undef, undef) called at cpanel.pl line 1720
cpanel::cpanel::real_exectag("<cpanel cPAddons=\"mainpg()\">", undef, undef, 1) called at cpanel.pl line 1428
cpanel::cpanel::docpanelaction(HASH(0x622dd08)) called at cpanel.pl line 4969
cpanel::cpanel::run_fast_json_mode() called at cpanel.pl line 832
cpanel::cpanel::script("cpanel::cpanel", "--json-fast-connect", "--stdin") called at cpanel.pl line 295
[2016-09-17 12:04:59 -0700] warn [cPAddons::mainpg] Encountered error in cPAddons::mainpg: cPAddons::mainpg() failed: Can't use string ("") as a HASH ref while "strict refs" in use at /usr/local/cpanel/Cpanel/cPAddons.pm line 330.
---
apiversion: 1
data:
result: "<div class=\"body-content\">\n<style>#er { color: #FF0000; }</style>\n"
error: "cPAddons::mainpg() failed: Can't use string (\"\") as a HASH ref while \"strict refs\" in use at /usr/local/cpanel/Cpanel/cPAddons.pm line 330.\n"
event:
reason: "cPAddons::mainpg() failed: Can't use string (\"\") as a HASH ref while \"strict refs\" in use at /usr/local/cpanel/Cpanel/cPAddons.pm line 330.\n"
result: 0
func: mainpg
module: cPAddons
source: module
type: event
In looking at the module file in question (/usr/local/cpanel/Cpanel/cPAddons.pm) it appears that any params passed to it are passed as a string and not as a hash; therefore, it errors out. I cannot figure out how to pass it the parameters in the format expected.
Any assistance would be appreciated! I eventually want to install the cPanel::Blogs::WordPress addon via the API, but I can't seem to get past step one yet.