kirobo
kirobo

Reputation: 313

WHM Getting Error - Sudomain Module (API)

This is the error I get when creating a subdomain via cpanel API https://i.sstatic.net/QYaLD.jpg

Kindly help.

Upvotes: 0

Views: 74

Answers (2)

jagjeet
jagjeet

Reputation: 377

To create a subdomain via cpanel API you can try below code :-

    require_once 'xmlapi.php';
    $api2args = array(
        'domain' => 'subdomain',   // name of the subdomain to be created
        'rootdomain' => 'example.com',  // main domain under which sub 
                                     domain needs to be created
        'dir'  => '/public_html/directory_name',  // directory to generate 
                                           for this subdomain
        'disallowdot'           => '1'
    );

    $result = $xmlapi->api2_query($cpanel['username'], 'SubDomain', 
              'addsubdomain', $api2args);

Upvotes: 0

Bogdan Stoica
Bogdan Stoica

Reputation: 4529

Please check the link bellow, it might provide the answer you are looking for: https://forums.cpanel.net/threads/add-subdomain-using-api.119609/

Upvotes: 0

Related Questions