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!

Unable to connect

Discussion in 'cPanel Developers' started by Rohan Purekar, Jul 7, 2015.

  1. Rohan Purekar

    Rohan Purekar Registered

    Joined:
    May 31, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nagpur
    cPanel Access Level:
    Website Owner
    Hello
    I am trying to use Cpanel's API 2 but i am getting this error
    Fatal error: Class 'CPANEL' not found.

    Is there any file because in xmlapi.php this class wasn't there
    PHP:
    <?php
    include ('xmlapi.php');
    $cpanel = new CPANEL(); // Connect to cPanel - only do this once.
    // Authorizes the "remote.example.com" remote host
    $authorize_host $cpanel->api2(
        
    'MysqlFE''authorizehost',
        array(
            
    'host' => 'www.domainname.com',
        )
    );
    ?>
    this is what I have been trying to do to learn API 2.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,699
    Likes Received:
    1,790
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Rohan Purekar

    Rohan Purekar Registered

    Joined:
    May 31, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nagpur
    cPanel Access Level:
    Website Owner
    I am still getting that error! I downloaded that xmlapi.php file and included it once again. In fact there is no cpanel() function defined in that file... Please suggest what to do? its really important.:(
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,699
    Likes Received:
    1,790
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice