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.

cpanel/whm + XMLAPI + error messages - help please!

Discussion in 'cPanel Developers' started by harshmallow, Dec 21, 2011.

  1. harshmallow

    harshmallow Registered

    Joined:
    Dec 21, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi there.

    I'm trying to create subdomains using cpanel api2 functions.

    If i try and do something simple like

    listaccts(); - this works fine.

    If I try and do the subdomain creation, I get this error: (I've removed my exact directory structure from the error code)

    [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"]<b>Fatal error</b>: Uncaught exception 'Exception' with message 'curl_exec threw error &quot;SSL read: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac, errno 0&quot; for https://myiphere:2087/xml-api/cpane...allowdot=0&amp;domain=testing&amp;rootdomain=[mydomain]&amp;cpanel_xmlapi_user=root&amp;cpanel_xmlapi_module=SubDomain&amp;cpanel_xmlapi_func=addsubdomain&amp;cpanel_xmlapi_apiversion=2' in /home/[user]/public_html/xmlapi.php:730[/TD] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"]Stack trace:[/TD] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"]#0 /home/[user]/public_html/xmlapi.php(652): xmlapi-&gt;curl_query('https://91.103....', 'dir=public_html...', 'Authorization: ...')[/TD] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"]#1 /home/[user]/public_html/xmlapi.php(875): xmlapi-&gt;xmlapi_query('cpanel', Array)[/TD] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"]#2 /home/[user]/public_html/subdrcreate.php(46): xmlapi-&gt;api2_query('root', 'SubDomain', 'addsubdomain', Array)[/TD] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"]#3 {main}[/TD] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"] thrown in <b>/home/[user]/public_html/xmlapi.php</b> on line <b>730</b><br /> Any ideas how I can get round this? Have I done something wrong? This is my test script:
    PHP:
    $auth_user "root";$auth_pass "passwordhere";

    include(
    "includes/xmlapi.php");
    $ip "myip";

    $xmlapi = new xmlapi($ip);//$xmlapi->hash_auth("root",$whmhash);$xmlapi->password_auth($auth_user, $auth_pass);
    $xmlapi->set_output('xml');$xmlapi->return_xml(1);$xmlapi->set_debug(1);
    $domain "testing";$rootdomain 'rootdomain'$usecanonicalname 0$disallowdot 0$dir 'public_html/iwantittopointhere/';$cpuser="root";
    $arraySubDomain2 = array(  'dir'          => $dir'disallowdot'  => $disallowdot'domain'       => $domain'rootdomain'   => $rootdomain );  
    //print $xmlapi->listaccts();print $xmlapi->api2_query($cpuser, "SubDomain", "addsubdomain", $arraySubDomain2);
    Any help would be greatly appreciated. I've never used these APIs before, so I'm learning as I go... Many thanks! tasha[/TD]
     
  2. harshmallow

    harshmallow Registered

    Joined:
    Dec 21, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Update: after spending a whole day trying to get this to work and finally giving in and posting for help, I just tried giving the user for the domain root priveleges and now it seems to work. Whether this was the right way round or not, I don't know, but it works.
     
  3. harshmallow

    harshmallow Registered

    Joined:
    Dec 21, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I do have another question however. My addsubdomain script redirects appropriately after creating the new subdomain.

    However, the script with delsubdomain stops immediately after it has deleted the subdomain. There's more script to run after and addsubdomain is called again further down the page but it never gets there.

    Has anyone encountered this sort of issue before?

    Thanks in advance :)
     
Loading...

Share This Page