Default Subdomain creation using php

Hello, this is what i want.

I have two domains in godadday hosting

firstdomain

seconddomain

I have this code running in firstdomain but i wanna create sub-domain for seconddomain using following code.

[php] $cpanelusr = ‘username’;
$cpanelpass = ‘password’;
$xmlapi = new xmlapi(‘seconddomain.com’);
$xmlapi->set_port( 2083 );
$xmlapi->password_auth($cpanelusr,$cpanelpass);
$xmlapi->set_debug(1); //output actions in the error log 1 for true and 0 false
$result
= $xmlapi->api2_query($cpanelusr, ‘SubDomain’, ‘addsubdomain’,
array(“$subdomain_name”,‘seconddomain.com’,0,0,
‘/public_html/project3/user’));
[/php]

I am getting this error “curl_exec threw error “couldn’t connect to host”…”

Port 2083 would be the SSL port. You sure you didnt mean to use 2082 there?

@StarLion i used port 2083 because godaddy using https to access cpanel but i tried port 2082 after your reply. It’s still not working.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.