Hi jgames88,
The code example you provided should work fine as far as creating the subdomain. However, there's one technical error that I'm surprised didn't throw a warning. The query methods ("xmlapi_query", "api1_query", and "api2_query") all return a SimpleXML object by default. So, in you last line you're using a "print" statement on an object, which is likely to fail in this particular case. If you want to see the results, as a whole, either do "var_dump($result)" or "print $result->asXML()" or "echo $result->asXML()"
The variable "$ip" is the IP address of the machine that hosts your account. If you're invoking you script on the server that has you account, you can leave it with '127.0.0.1'. That particular address is a loopback; it just points to the localhost, e.g. the server you're on.
What is the exact output of that? If you're invoking that code on a cPanel box, the debug output is likely going to the cPanel error_log. If you're running on a non-webserver, say like your laptop of PC, the debug messages will likely just be printed to the screen (STDOUT).
Do you have access to the cPanel error log? It's located at /usr/local/cpanel/logs/error_log. That might yield some information other than debugging from the class; some system warnings, etc.
Need to make sure you have cURL or have fopen wrappers that can stream the request, but unless you're in a restrictive environment, fopen should be there and available by default.
Have you tried to execute a call that just fetches information?
try something like StatsBar::stat
Code:
// you setup code here
$args = array( 'display' => 'phpversion|emailaccounts') ;
$result = $xmlapi->api2_query($account, "StatsBar", "stat", $args);
var_dump($result);
That code should render info related to you PHP version and how many POP email accounts you have,
Code:
// example snippet of output //
SimpleXMLElement Object
(
[apiversion] => 2
[data] => Array
(
[0] => SimpleXMLElement Object
(
[name] => phpversion
[_maxed] => 0
[count] => SimpleXMLElement Object
(
)
[id] => phpversion
[item] => PHP version
[langkey] => INDXPHPver
[max] => SimpleXMLElement Object
(
[0] =>
)
[module] => Serverinfo
[percent] => 0
[percent10] => 0
[percent20] => 0
[percent5] => 0
[value] => 5.2.9
)
[1] => SimpleXMLElement Object
(
[name] => emailaccounts
[_count] => 2
[_max] => unlimited
[_maxed] => 1
[count] => 2
[feature] => popaccts
[id] => emailaccounts
[item] => Email Accounts
[langkey] => INDXEmailAccounts
[max] => unlimited
[module] => Email
[percent] => 0
[percent10] => 0
[percent20] => 0
[percent5] => 0
[zeroisunlimited] => 0
)
)
)
Regards,
-DavidN