Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Creating an account via API freeze

Discussion in 'General Discussion' started by craigbaines, Dec 18, 2016.

  1. craigbaines

    craigbaines Registered

    Joined:
    Dec 18, 2016
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Reseller Owner
    Hi all,

    Iv'e just got myself a resller account, and im having some slight issues trying to automate my cpanel account creations.

    So far, iv'e only ran a little test script, to use the api an create the account. It works with:

    GitHub - CpanelInc/xmlapi-php: A PHP Class for Interacting with cPanel's XML-API

    Snippet:

    Code:
    <?php
    
    include_once 'xmlapi.php';
    
    $xmlapi = new xmlapi($_SERVER['HTTP_HOST']);
    $xmlapi->set_port(2087);
    $xmlapi->password_auth('USERNAME', 'PASSWORD');
    $xmlapi->set_output('array');
    $xmlapi->set_debug(0);
    
    $newAccount = array(username => "example2",
    password => "1234567",
    domain => "example2.com",
    pkgname => "myPAckage",
    contactemail => "example2@example.com");
    
    $account_status = $xmlapi->createacct($newAccount);
    
    echo("DONE");
    ?>

    It works just fine, the account is created fairly quickly, the problem is the php script seems to get stuck waiting on the response i assume? the "DONE" won't get echoed, an the page eventually dies via timeout. I can't go ahead an put this into my site as is because the rest of the script wouldn't get ran....

    I found this post from another user:

    WHM API1 createacct slowness


    Which is almost identical to my problem. I have gone ahead an asked my hosts to change the Apache WORKER MPM setting as he mentions, but they have delayed in doing so and right now im left just twiddling my thumbs hoping they get around to it sooner rather than later.

    I thought i would post here in the mean time to see if there is anything else anyone knows of that could be causing it to happen.

    Appreciate your help,

    Thanks - Craig.
     
    #1 craigbaines, Dec 18, 2016
    Last edited by a moderator: Dec 18, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,428
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you have access to modify PHP settings on your account? If so, you could increase the max_execution_time value for PHP until you hear back from your web hosting provider.

    Thank you.
     
Loading...

Share This Page