cPanel::runtimeexception (using api2)
Hi All,
I have spent a few hrs attempting to dump monthly bandwidths per cPanel user as we have been requested by some clients. Below is a list of my code and the error I am getting
The below code is the code ran from my public html folder calling from live.php (from research this file should be named .live.php and located in the folder called?)
This code is directly from .live.php and is based on the information stated at cPanel API 2 Functions - Stats::getmonthlybandwidth - Developer Documentation - cPanel Documentation
After following the wiki and looking online for suggestions etc I am unsure where to go from here, Even if I remove the //get domain user data block from .live.php it still doesn't work. any help you can give I will be grateful for. My end goal is to simply pull a list of all monthly bandwidth usage for all cPanel users and storage used compared to how much they have.. then dump it into an readable format.
This code is directly from .live.php and is based on the information stated at cPanel API 2 Functions - Stats::getmonthlybandwidth - Developer Documentation - cPanel Documentation
uapi(
'DomainInfo', 'domains_data',
array(
'format' => 'hash',
)
);
// Retrieve bandwidth data by month for example.com
$get_bandwidth_by_month = $cpanel->api2(
'Stats', 'getmonthlydomainbandwidth'
);
After following the wiki and looking online for suggestions etc I am unsure where to go from here, Even if I remove the //get domain user data block from .live.php it still doesn't work. any help you can give I will be grateful for. My end goal is to simply pull a list of all monthly bandwidth usage for all cPanel users and storage used compared to how much they have.. then dump it into an readable format.
Please sign in to leave a comment.
Comments
0 comments