Ajay_Kumar
Ajay_Kumar

Reputation: 1387

subdomain creation problem dyamicaly in php

I have a function code to make subdomain dynamically by php.Code is below

<?php

define('CPANELUSER','username');
define('CPANELPASS','password');
define('CPANEL_SKIN','x3');
define('DOMAIN','www.abcd.com ');


$result = subd('localhost',2082,$cpaneluser,$cpanelpass,$request);

function subd($host,$port,$ownername,$passw,$request) {

  $sock = fsockopen('localhost',2082);

  if(!$sock) {    
    print('Socket error');
    exit();
  }
  // ...

This is working ok on my testing server.But when i transfer file to customer server this is not working. Customer server is "iPage" and i m getting an error "Socket error".I m not understating why this is error is occurring even this was working fine in previous server.And there are no any skin name is available in iPage too.Help me. Thanks

Upvotes: 0

Views: 224

Answers (2)

Aif
Aif

Reputation: 11220

Strauberry is right. Nevertheless, it seems that you can use Cpanel API to perform such tasks.

Upvotes: 1

strauberry
strauberry

Reputation: 4199

maybe your customer server's configuration disallows the usage of a socket connection. Use the debug parameters of fsockopen (http://de2.php.net/manual/en/function.fsockopen.php) to get a clear image of what's going wrong. The error number and error string would be very helpful!

Upvotes: 1

Related Questions