The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API2 Code working but timing out

Discussion in 'cPanel Developers' started by graham23s, Oct 3, 2016.

Tags:
  1. graham23s

    graham23s Registered

    Joined:
    Oct 3, 2016
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    uk
    cPanel Access Level:
    Website Owner
    Hi Guys,

    I have an issue with the api2 queries, my code for adding a new doman and ftp is:
    Code:
      // setup
      $xmlapi = new xmlapi($cpanelH);
      $xmlapi->password_auth($cpanelU,$cpanelP);
      $xmlapi->set_debug(1);
      $xmlapi->set_port(2083);
      $xmlapi->set_output('array');
      // setup
    
      // add an addon-domain
      $args1  = array('dir'=> "public_html/".$cpanelD, 'newdomain'=> $cpanelD, 'subdomain'=> $cpanelD);
      $query1 = $xmlapi->api2_query($cpanelU, 'AddonDomain', 'addaddondomain', $args1);
      print "<pre>"; print_r($query1); print "</pre>";
      // add an addon-domain
    
      // add an ftp account
      $args2 = array('user'=> $cpanelF, 'pass'=> $cpanelP, 'quota'=> 20, 'homedir'=> "public_html/".$cpanelD);
      $query2 = $xmlapi->api2_query($cpanelU, 'Ftp', 'addftp', $args2);
      print "<pre>"; print_r($query2); print "</pre>";
      // add an ftp account
    
    
    The code DOES work, the problem is the addon domain query (query1) executes then timeouts, i never receive a response, i do with (query2) it returns the simplexml fine, i cannot figure out the issue!

    any tips would be appreciated

    Graham
     
    #1 graham23s, Oct 3, 2016
    Last edited by a moderator: Oct 4, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page