Recently I am trying to create an database and its user with help of this class. And I tried the following code.
include_once("xmlapi.php"); // this can be downlaoded from https://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php
$ip = getenv('REMOTE_HOST');
$root_pass = getenv('REMOTE_PASSWORD');
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_debug(1);
$acct = array( username => "someuser", password => "pass123", domain => "exampledoamin.com"); // here i used my domain name.
print $xmlapi->createacct($acct);
but its return the following error.
Fatal error: Uncaught exception 'Exception' with message 'No host defined' in
And its showing error when i require the master file. What's wrong in my code. I couldn't find the bug. Am I missed anything.
Edit:
Var_dump($ip);
bool(false)
;