我正在尝试使用cpanel api2修改其中一个cpanel帐户的区域文件。以下是我正在执行的代码。Cpanel api2 Zoneedit错误
$xmlapi = new xmlapi($ip);
$xmlapi->set_host("192.168.1.1");
$xmlapi->set_port("2087");
$xmlapi->set_protocol('https');
$xmlapi->password_auth($cpusername,$cpuserpwd);
$xmlapi->hash_auth("root",$root_hash);
#print_r ($xmlapi);
$xmlapi->set_output("json");
$xmlapi->set_debug(1);
$xmlapi->api2_query($cpaccount, "ZoneEdit", "add_zone_record" , array($domain, $subdomain, $type, $ipaddr, $ttl));
评论代码使用系统散列进行验证。另一个使用密码认证。两种身份验证方法都会出现相同的错误。
当我设置的用户ID和帐户根,我得到一个内部500错误:
Internal Server Error 500
Could not setuid to root at /usr/local/cpanel/Whostmgr/XMLUI/cPanel.pm line 82.
如果我更改用户标识和区域文件是该帐户,我得到的消息:
{
"cpanelresult":{
"apiversion":2,
"func":"add_zone_record",
"data":[{
"result":{
"status":0,
"statusmsg":"You do not have permission to read the zone for : "
}
}],
"event":{
"result":1
},
"module":"ZoneEdit"
}
}
我很难下一步做什么。当我在命令行中作为非root帐户之一登录时,只要输入root密码就可以启动root。
任何援助将不胜感激。