Problem with CMD_API_SUBDOMAINS

silverstay

New member
Joined
Aug 1, 2013
Messages
1
I'm trying to create a subdomain with php. I have read a bunch of texts, found even some examples, configured at my needs, but it doesnt seem to work
Im using httpsocket. If it can't connect if shows error, but when its seems to be fine, the page just loads, loads and loads. It never stops. I have to reset session, in order to get back to page. Can anyone help me.

Im using these kind of lines to create subdomain.
PHP:
 $sock = new HTTPSocket;
        $sock->connect('localhost',2222);
        $sock->set_login("*username*","*password*"); //*username* - username , *password* - password
        $sock->set_method('POST');
        $sock->query('/CMD_API_SUBDOMAINS',
        array(
                'action' => 'create',
                'domain' => 'mydomain.com',
                'subdomain' => 'subdom'
                
        ));

        $result = $sock->fetch_body();

can anyone help me, and tell me if im doing something wrong.
I've been around this problem for a 3 days, and i just cant to figure it out.
Am i missing something?


Bunch of thanks.
 
Hello,

Run DA in debug mode, then trigger your script.
Check to see what DA says is going on.
http://help.directadmin.com/item.php?id=293

Also check.. if you've setup DA on 2222 to use ssl (https), then you'd need to set:
'ssl://localhost' instead of 'localhost'

Check:
/etc/hosts
to ensure that 127.0.0.1 is set to localhost.

John
 
Back
Top