Problems with cpapi2 listparkeddomains
That just dumps all the commands. So I tried the command in PuTTY:
[root@server:/root]$ cpapi2 --user=root Park listparkeddomains
[2018-12-03 17:50:12 -0500] warn [Internal Warning while parsing unknown 23005] Use of uninitialized value $Cpanel::CPDATA{"DNS"} in hash element at /usr/local/cpanel/Cpanel/Park.pm line 298.
at /usr/local/cpanel/Cpanel/Park.pm line 298.
Cpanel::Park::api2_listparkeddomains("api.function", "listparkeddomains", "api.module", "Park") called at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 134
eval {...} called at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 134
Cpanel::Api2::Exec::api2_exec("Park", "listparkeddomains", HASH(0x2f51050), HASH(0x2f50df8)) called at cpanel.pl line 1278
cpanel::cpanel::docpanelaction(HASH(0x2f50eb8)) called at cpanel.pl line 4227
cpanel::cpanel::run_fast_json_mode() called at cpanel.pl line 840
cpanel::cpanel::script("cpanel::cpanel", "--json-fast-connect", "--stdin") called at cpanel.pl line 271
---
cpanelresult:
apiversion: 2
data: []
event:
result: 1
func: listparkeddomains
module: Park
[root@server:/root]$
So even though I somehow found a working command - it's broken!!! I'm staring straight down the shotgun barrel of having my entire December completely obliterated here. All I need is to use PHP to list parked domains and add a new parked domain. That is IT! Literally my entire life hangs by this literal thread. Please HELP!
-
So UAPI hasn't replaced cpapi2 yet as of almost October 2024. So I'm responding to my thread from six years ago to clarify what needs to happen when.
When in the terminal the user PHP uses must be specified:
cpapi2 --user=php_user Park listparkeddomains --output=json
However the exact same command will not work in PHP unless the user parameter is removed:
cpapi2 Park listparkeddomains --output=json
1 -
Maybe Andy Baugh has some thoughts on this issue?
1 -
Rex, I appreciate your replies a lot. I want to clarify that my second post here was just to clarify to myself (and anyone else who comes across this via a search) how to run the commands properly in two different contexts.
I would have gotten to the other thread ("UAPI has no documentation for cron jobs but replacing API 2?") that comes up naturally by tomorrow morning after finishing setting up my audit of cPanel commands and catching back up on emails. I'm a couple hours away from completing for the verification part of my internal administration relating to that other thread. His post there helps tremendously. Your posts, especially this year have also helped tremendously. Thank you!
0 -
Oh nice, and thanks for the kind words!
1 -
Rex, in a world where I've been down-voted in to hell by people who think they know more but do the wrong thing getting useful responses that help me build and protect my business so that I can greatly improve the lives of others - yeah, it's a rarity and I want you and the few others who contribute to know of my appreciation.
1
Please sign in to leave a comment.
Comments
5 comments