Reading the whmapi1 Output in PHP

Vs Nu

Well-Known Member
Jul 17, 2015
104
7
68
India
cPanel Access Level
Root Administrator
whmapi1 set_tweaksetting key=phploader value=ioncube,sourceguardian
---
metadata:
command: set_tweaksetting
reason: OK
result: 1
version: 1


I need to read the output via PHP to do an if or else statement

How to read this ?
 

cPanelChristine

Technical Analyst
Staff member
Aug 10, 2018
57
11
83
Houston, TX
cPanel Access Level
Root Administrator
Hello,

While we understand that this request is in regards to the cPanel Software, we must note that providing assistance with writing PHP code is not the cPanel Forums intended use.

Other users of this forum may be able to share that you could do, but your best option may be to reference a forum such as this for example.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
2,067
283
213
cPanel Access Level
Root Administrator
@Vs Nu - are you just looking for a check to see if the call completed properly or not? If so, the "result: 1" section of the output is what would indicate success, so if you base your PHP code around that response, that would be the ideal way to measure success.