Hello all,
I am using the ISPConfig API (with PHP). I was able to run it pretty well until I had hit this issue.
I am getting the following error when trying to add web domain to the system:
session_does_not_existThe Session is expired or does not exist.
Below are the code and inputs.
Does anyone out there know why this is taking place or what one can do to troubleshoot it further?
TIA
The output
Logged successfull. Session ID:b375a638d8c5bc20baee88750c6711a1
Session ID set is: b375a638d8c5bc20baee88750c6711a1
The items passed in
Array ( [server_id] => 1 [ip_address] => * [domain] => foofoo.com [type] => vhost [parent_domain_id] => 0 [vhost_type] => name [document_root] => /var/www/clients/client41/web123 [system_user] => web123 [system_group] => client41 [hd_quota] => 100000 [traffic_quota] => -1 [cgi] => y [ssi] => y [suexec] => y [errordocs] => 1 [is_subdomainwww] => 1 [subdomain] => www [php] => fast-cgi [ruby] => n [redirect_type] => [redirect_path] => [ssl] => n [ssl_state] => [ssl_locality] => [ssl_organisation] => [ssl_organisation_unit] => [ssl_country] => [ssl_domain] => [ssl_request] => [ssl_cert] => [ssl_bundle] => [ssl_action] => [stats_password] => [stats_type] => webalizer [allow_override] => All [apache_directives] => [php_open_basedir] => /var/www/clients/client41/web123/web:/var/www/clients/client41/web123/tmp:/var/www/stashandcarry.com/web:/srv/www/stashandcarry.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin [custom_php_ini] => [backup_interval] => none [backup_copies] => 1 [active] => y [traffic_quota_lock] => n )
PHP Code:
public function __siteaddwebdomain( $inrecserverid, $inrecclientid, $indomainid, $inwebsiteid,
$inlinuxuser, $webrootdir, $injoomlaid, $indomname ){
try {
$affected_rows = -999999;
if ( !( $inrecclientid > 0 and $inrecclientid < 9999 ) ) {
die("=> ERROR: Invalid client id: $inrecclientid was passed into function. Check the system");
}
$wlinuxgroup = "client" . $inrecclientid;
$wlinuxuser = "web" . $injoomlaid;
$wsetroot = $webrootdir . "/" . $wlinuxgroup . "/" . $wlinuxuser;
echo "=> Linux Group: $wlinuxgroup Linux User: $wlinuxuser will be created <br />";
if($session_id = $this -> ispclient->login($this -> ispcusername,
$this -> ispcpassword)) {
echo '<br />Logged successfull. Session ID:'.$session_id.'<br />';
}
$params = array(
'server_id' => $inrecserverid,
'ip_address' => '*',
'domain' => $indomname,
'type' => 'vhost',
'parent_domain_id' => 0,
'vhost_type' => 'name',
'document_root' => $wsetroot,
'system_user' => $wlinuxuser,
'system_group' => $wlinuxgroup,
'hd_quota' => 100000,
'traffic_quota' => -1,
'cgi' => 'y',
'ssi' => 'y',
'suexec' => 'y',
'errordocs' => 1,
'is_subdomainwww' => 1,
'subdomain' => 'www',
'php' => 'fast-cgi',
'ruby' => 'n',
'redirect_type' => '',
'redirect_path' => '',
'ssl' => 'n',
'ssl_state' => '',
'ssl_locality' => '',
'ssl_organisation' => '',
'ssl_organisation_unit' => '',
'ssl_country' => '',
'ssl_domain' => '',
'ssl_request' => '',
'ssl_cert' => '',
'ssl_bundle' => '',
'ssl_action' => '',
'stats_password' => '',
'stats_type' => 'webalizer',
'allow_override' => 'All',
'apache_directives' => '',
'php_open_basedir' => "/var/www/clients/$wlinuxgroup/$wlinuxuser/web:/var/www/clients/$wlinuxgroup/$wlinuxuser/tmp:/var/www/stashandcarry.com/web:/srv/www/stashandcarry.com/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin",
'custom_php_ini' => '',
'backup_interval' => 'none',
'backup_copies' => 1,
'active' => 'y',
'traffic_quota_lock' => 'n'
);
$readonly = false;
echo "<br /> Session ID set is: $session_id <br />";
echo "<br /> The items passed in <br /> ";
print_r($params);
$affected_rows = $this -> ispclient -> sites_web_domain_add($inrecserverid, $inrecclientid,
$params, $readonly);
echo "Web Domain ID: ".$affected_rows."<br>";
if($this -> ispclient ->logout($session_id)) {
echo 'Logged out.<br />';
}
} catch (SoapFault $e) {
echo $this -> ispclient ->__getLastResponse();
die('SOAP Error ADD WEB DOMAIN: '.$e->getMessage());
}
return $affected_rows;
}
Recent comments
5 hours 5 min ago
11 hours 46 min ago
15 hours 36 min ago
17 hours 15 min ago
1 day 1 hour ago
1 day 11 hours ago
1 day 11 hours ago
1 day 15 hours ago
1 day 19 hours ago
1 day 20 hours ago