mgufrone / cpanel-php

CPanel/WHM API for PHP
MIT License
158 stars 91 forks source link

Uncaught Error: Class 'Gufy\CpanelPhp\Cpanel' not found #35

Open SwapnilAkolkar opened 4 years ago

SwapnilAkolkar commented 4 years ago

hi I just new bee here I wanted know how to use it I hit command for composer n files were get downloaded in my localhost xampp in winodws C:\xampp\htdocs\cpanel\vendor\gufy\cpanel-php\src\Gufy\CpanelPhp this is my path to Cpanel.php

in C:\xampp\htdocs\cpanel I wrote index.php with code <?php $cpanel = new \Gufy\CpanelPhp\Cpanel([ 'host' => 'https://123.456.789.123:2087', // ip or domain complete with its protocol and port 'username' => 'root', // username of your server, it usually root. 'auth_type' => 'hash', // set 'hash' or 'password' 'password' => 'password', // long hash or your user's password ]);

$accounts = $cpanel->listaccts(); // it will returned as array

I gives me error Fatal error: Uncaught Error: Class 'Gufy\CpanelPhp\Cpanel' not found in C:\xampp\htdocs\cpanel\index.php:2 Stack trace: #0 {main} thrown in C:\xampp\htdocs\cpanel\index.php on line 2

how I can give reference to the CPanel.php file I tried to give full path by require once but it still gives error.

JamesThanna commented 4 years ago

Can you provide the full code and error so we can take a look?