Hello,
Our web application requires that we create database, tables and users with php. We are trying to use the following code:
<?php
include 'httpsocket.php';
$dbname = "testdatabase";
$dbuser = "testdatabase";
$dbpass = "testdatabase";
$sock = new HTTPSocket;
$sock->connect('domain.com',2222);
$sock->set_login("admin|da_admin","P@@sssw0rd");
echo '<pre>';
print_r($sock);
echo '</pre>';
$sock->set_method('POST');
$sock->query('/CMD_API_DATABASES',
array(
'action' => 'create',
'name' => $dbname,
'user' => $dbuser,
'passwd' => $dbpass,
'passwd2' => $dbpass
));
$result = $sock->fetch_body();
?>
We are getting the following output
HTTPSocket Object
(
[version] => 2.7.2
[method] => GET
[remote_host] =>domain.com
[remote_port] => 2222
[remote_uname] => admin|da_admin
[remote_passwd] => P@@sssw0rd
[result] =>
[result_header] =>
[result_body] =>
[result_status_code] =>
[lastTransferSpeed] =>
[bind_host] =>
[error] => Array
(
)
[warn] => Array
(
)
[query_cache] => Array
(
)
[doFollowLocationHeader] => 1
[redirectURL] =>
[max_redirects] => 5
[ssl_setting_message] => DirectAdmin appears to be using SSL. Change your script to connect to ssl://
[extra_headers] => Array
(
)
)
DirectAdmin appears to be using SSL. Change your script to connect to ssl://
Can someone please point us to the right direction?
Our web application requires that we create database, tables and users with php. We are trying to use the following code:
<?php
include 'httpsocket.php';
$dbname = "testdatabase";
$dbuser = "testdatabase";
$dbpass = "testdatabase";
$sock = new HTTPSocket;
$sock->connect('domain.com',2222);
$sock->set_login("admin|da_admin","P@@sssw0rd");
echo '<pre>';
print_r($sock);
echo '</pre>';
$sock->set_method('POST');
$sock->query('/CMD_API_DATABASES',
array(
'action' => 'create',
'name' => $dbname,
'user' => $dbuser,
'passwd' => $dbpass,
'passwd2' => $dbpass
));
$result = $sock->fetch_body();
?>
We are getting the following output
HTTPSocket Object
(
[version] => 2.7.2
[method] => GET
[remote_host] =>domain.com
[remote_port] => 2222
[remote_uname] => admin|da_admin
[remote_passwd] => P@@sssw0rd
[result] =>
[result_header] =>
[result_body] =>
[result_status_code] =>
[lastTransferSpeed] =>
[bind_host] =>
[error] => Array
(
)
[warn] => Array
(
)
[query_cache] => Array
(
)
[doFollowLocationHeader] => 1
[redirectURL] =>
[max_redirects] => 5
[ssl_setting_message] => DirectAdmin appears to be using SSL. Change your script to connect to ssl://
[extra_headers] => Array
(
)
)
DirectAdmin appears to be using SSL. Change your script to connect to ssl://
Can someone please point us to the right direction?