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.

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:
    30,724
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  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:
    30,724
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page