I have a website where the user create his own site, and for that i need to create a subdomain. My server has cPanel, so I´m creating the subdomain in cPanel using PHP code. The problem is that the subdomain is created correctly and the folder in the server too, but when i try to access it the server is not found. The subdomain doesn´t create in the DNS file zone by this way.
I haven´t got the problem if I create the subdomain manually with the cPanel interface. In this case i can access to the subdomain. My hosting is Godaddy.
I'm using the next php code:
The code is working, because the subdomain appears in cPanel. But I can´t acces to it. Do you know what´s the problem? I haven´t got any problem in other servers, but i have this problem in godaddy.
Thanks!
I haven´t got the problem if I create the subdomain manually with the cPanel interface. In this case i can access to the subdomain. My hosting is Godaddy.
I'm using the next php code:
PHP:
$pass = base64_encode("$cpanel_user:$cpanel_pass");
$in = "GET /frontend/$cpanel_skin/subdomain/doadddomain.html?rootdomain=$cpanel_host&domain=$subdomain&dir=public_html/subdomains/$subdomain\r\n";
$in .= "HTTP/1.0\r\n";
$in .= "Host:$cpanel_host\r\n";
$in .= "Authorization: Basic $pass\r\n";
$in .= "\r\n";
fputs($sock, $in);
while (!feof($sock)) {
$result .= fgets ($sock,128);
}
fclose($sock);
Thanks!