Bart, I find the that following script does the trick just fine:
Code:
$whmusername = "root";
$whmpassword = "somepassword";
$username = "someuser";
$owner = "root";
$query = "https://127.0.0.1:2087/scripts/dochangeowner?user=" . $username . "&owner=" . $owner; #build query
$curl = curl_init(); # Create Curl Object
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); # Return contents of transfer on curl_exec
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0); # Allow self-signed certs
curl_setopt($curl, CURLOPT_USERPWD, $whmusername.":".$whmpassword); # set the username and password
curl_setopt($curl, CURLOPT_URL, $query);
$result = curl_exec($curl);
if ($result == false) {
error_log("curl_exec threw an error for $query");
}
print $result;