Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PauloMotaZetec opened this issue Mar 2, 2021 · 0 comments
Open

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

PauloMotaZetec opened this issue Mar 2, 2021 · 0 comments

Comments

@PauloMotaZetec
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant