There is a code, the forums work for everyone normally ... And I do not have :)

include 'httpsocket.php'; $sock = new HTTPSocket; $sock->connect('yoursite.com',2222); $sock->set_login("admin|{username}","{admin_password}"); $sock->set_method('POST'); $sock->query('/CMD_API_SUBDOMAINS', array( 'action' => 'create', 'domain' => '{parent_domain}', 'subdomain' => '{subdomain_name}' )); $result = $sock->fetch_body(); echo $result; 

This code adds a subdomain through the DA panel. But when doing it he writes:

 "DirectAdmin appears to be using SSL. Change your script to connect to ssl://" 

I realized that he asks to write 'ssl: //' before the address of the site. But, when I insert 'ssl: //', or still tried 'https: //', it does not pop up any answers, a white sheet and no subdomain is created. Help me to understand.

    1 answer 1

    Found the answer, can someone come in handy! We add ssl: // to the domain, yoursite.com is not quite right, there should be a path to the admin panel of the hoster, in my case it was srv8.kerio-by.org . Next, admin | no need, username and admin_password - login and pass from the control panel. The last line is also not needed, in the end we got:

     $sock->connect('ssl://srv8.kerio-by.org',2222); $sock->set_login("login","pass");