I've tried the script on 2 production servers and on my dev server. The script didn't work on either server.
I've tried XML API PHP but I have pretty much the same issues:
With:
PHP Code:
include("xmlapi.php");
$account = 'root';
$ip = "__IP HERE__";
$root_pass = "__PASS HERE__";
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_output('array');
$xmlapi->set_debug(1);
print_r($xmlapi->api2_query($account, "Cron", "listcron" ));
I get:
Warning: file_get_contents(https://.....:2087/xml-api/cpanel) [function.file-get-contents]: failed to open stream: No such file or directory in /usr/local/cpanel/whostmgr/docroot/module/xmlapi.php on line 724
And with:
PHP Code:
define('XMLAPI_USER_SSL', '1');
define('XMLAPI_USE_SSL', '0');
include("xmlapi.php");
$account = 'root';
$ip = "__IP HERE___";
$root_pass = "__PASS HERE__";
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_port(2086);
$xmlapi->set_output('array');
$xmlapi->set_debug(1);
print_r($xmlapi->api2_query($account, "Cron", "listcron" ));
I get:
Warning: file_get_contents(http://....:2086/xml-api/cpanel) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /usr/local/cpanel/whostmgr/docroot/module/xmlapi.php on line 724
but if instead of print_r($xmlapi->api2_query($account, "Cron", "listcron" )); i use something like print_r($xmlapi->listips()); it works. This is exactly what works in my version of the script. Non fast mode, non https query.