So here is the script I'm trying to run inside /scripts/postwwwacct:

PHP Code:

#!/usr/local/bin/php -q
<?php
include('xmlapi.php');

$opts = array();
$argv0 array_shift($argv);
while(
count($argv)) {
$key array_shift($argv);
$value array_shift($argv);
$opts[$key] = $value;
}


$account $opts['user'];
$email_domain $opts['domain'];

$email_user "emailaddress1";
$email_password "emailaccountpass";
$email_quota '110';


$ip "xxx.xxx.xxx.xxx";
$root_pass "mypassword";
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_output('xml');

$result $xmlapi->api1_query($account"Email""addpop", array($email_user$email_password$email_quota$email_domain) );

?>
And I'm using the sample xmlapi.php code provided by cpanel. If I change $account to a manual account name it seems to work ok. However, the way it stands now no e-mail account is created? So I'm thinking the opts array maybe isn't getting set, but of course I haven't found a way to debug any output when actually creating the account through the WHM, because it just says "running /scripts/postwwwacct" but doesn't give any output.

Does anyone see anything wrong or missing with this script?