Skip to content

Uncaught TypeError: array_key_exists(): Argument #2 #18

@PauloMotaZetec

Description

@PauloMotaZetec

I'm getting this error.

Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, ArrayObject given in C:\xampp\htdocs\tests\cpanel\Cpanel\Core\Object.php:111
Stack trace:
#0 C:\xampp\htdocs\tests\cpanel\Cpanel\Core\Object.php(74): Cpanel_Core_Object->setOptions(Array)
#1 C:\xampp\htdocs\tests\cpanel\Cpanel\PublicAPI.php(102): Cpanel_Core_Object->__construct(Array)
#2 C:\xampp\htdocs\tests\cpanel\Cpanel\PublicAPI.php(140): Cpanel_PublicAPI->__construct(Array)
#3 C:\xampp\htdocs\tests\cpanel\index.php(11): Cpanel_PublicAPI::getInstance()
#4 {main}
  thrown in C:\xampp\htdocs\tests\cpanel\Cpanel\Core\Object.php on line 111

The code is:

 // Include the autoloader
 require_once realpath( dirname(__FILE__) . '/Cpanel/Util/Autoload.php');
    
 // Make a configuration data array
 $config=array(
    'service'=> array(
        'whm'=> array(
            'config'   => array(
                'host'=> '95.217.75.9',
                'user'=> 'transpas',
                'password'=> 'K05c?@eMpW8]'
            ),
        ),
    ),
);
$cp=Cpanel_PublicAPI::getInstance($config);
$accounts=$cp->whm_api('listaccts');
print_R($accounts);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions