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.

SOLVED Need help with xmlapi.php usage

Discussion in 'cPanel Developers' started by mcSison, Sep 6, 2017.

  1. mcSison

    mcSison Registered

    Joined:
    Sep 6, 2017
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Philippines
    cPanel Access Level:
    Root Administrator
    Good day,

    Our team has encountered a hitch with our newly created test server in which we are trying to create a subdomain using xmlapi.php that uses functions such as api1_query() to create the subdomain, this method works with our older server. However upon trying the same on our new server we can't seem to create a subdomain. We are able to create a subdomain manually by going to the subdomains screen. upon checking that xmlapi.php created an error log that looks like this:

    Code:
    [06-Sep-2017 05:16:54 UTC] URL: [URL]https://$CPANEL_USER.com:2083/json-api/cpanel[/URL]
    [06-Sep-2017 05:16:54 UTC] DATA: dir=%2Fpublic_html%2Fsecured%2Fmcs&rootdomain=$CPANEL_USER.com&subdomain=test&user=$CPANEL_USER&cpanel_xmlapi_module=SubDomain&cpanel_xmlapi_func=addsubdomain&cpanel_xmlapi_apiversion=2
    [06-Sep-2017 05:16:54 UTC] Authentication Header: Authorization: Basic cmFjZXRvMWI6cmFjZS0xMjM=
    
    
    [06-Sep-2017 05:19:02 UTC] PHP Fatal error:  Uncaught exception 'Exception' with message 'curl_exec threw error "Failed to connect to $CPANEL_USER.com port 2083: Connection timed out" for [URL='https://$CPANEL_USER.com:2083/json-api/cpanel?dir=%2Fpublic_html%2Fsecured%2Fmcs&rootdomain=$CPANEL_USER.com&subdomain=test&user=$CPANEL_USER&cpanel_xmlapi_module=SubDomain&cpanel_xmlapi_func=addsubdomain&cpanel_xmlapi_apiversion=2']https://$CPANEL_USER.com:2083/json-api/cpanel?dir=/public_html/secured/mcs&rootdomain=$CPANEL_USER.com&subdomain=test&user=$CPANEL_USER&cpanel_xmlapi_module=SubDomain&cpanel_xmlapi_func=addsubdomain&cpanel_xmlapi_apiversion=2[/URL]' in /home/$CPANEL_USER/public_html/secured/cpanel/xmlapi.php:693
    Stack trace:
    #0 /home/$CPANEL_USER/public_html/secured/cpanel/xmlapi.php(615): xmlapi->curl_query('[URL]https://raceto1[/URL]...', 'dir=%2Fpublic_h...', 'Authorization: ...')
    #1 /home/$CPANEL_USER/public_html/secured/cpanel/xmlapi.php(814): xmlapi->xmlapi_query('cpanel', Array)
    #2 /home/$CPANEL_USER/public_html/secured/cpanel/index.php(41): xmlapi->api2_query('$CPANEL_USER', 'SubDomain', 'addsubdomain', Array)
    #3 {main}
      thrown in /home/$CPANEL_USER/public_html/secured/cpanel/xmlapi.php on line 693
    
    in which $CPANEL_USER is the username/host name. I have browsed the internet for anything related to our concern with no luck, being a beginner in development operations I still lack the knowledge to resolve such issues and would greatly appreciate any help from the community. thank you...
     
    #1 mcSison, Sep 6, 2017
    Last edited by a moderator: Sep 6, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Can you verify connection requests to the domain name in-question over port 2083 are working when tested manually? Do you have any firewall rules that are restricting access to port 2083?

    Thank you.
     
  3. mcSison

    mcSison Registered

    Joined:
    Sep 6, 2017
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    Philippines
    cPanel Access Level:
    Root Administrator
    Hi,

    Thank you for your reply, it would seem that it is a fire wall issue. I do not know the details since I am not the managing our firewalls but when I told our TechOps Team what you said and they were able to fix the issue immediately. Thank you very much.
     
    cPanelMichael likes this.
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    I'm glad to see the issue is now solved. Thank you for updating us with the outcome.
     
Loading...

Share This Page