cPanel's remote access (Accounting.php.inc)

datocp

Registered
Jun 12, 2007
4
0
51
Hello,
I've tried to follow the guide found here,But all I got is a blank page.
Both cURL and SSL mod are installed & enabled.
There's no value for open_basedir.
I've changed the username and hashkey (accesshash)
But I'm unsure about the hashkey:
I've removed all the new lines and spaces and entered it as 1 huge line. I'm unsure whether that's correct.
Thanks in advance!
Best regards,
datocp.
 

oulzac

Well-Known Member
Aug 7, 2005
131
0
166
The Remote Access Key, should be entered as its seen in WHM in the short multiple line format.
 

datocp

Registered
Jun 12, 2007
4
0
51
Thanks for your response!
I've tried to just copy & paste the remote access key-It didn't worked.
Then,I've tried to add a <br/> to the end of each line,But still-A blank page.
Can you please provide an example how should I enter the access key?
Thanks in advance!
Best regards,
datocp
 

oulzac

Well-Known Member
Aug 7, 2005
131
0
166
PHP:
#!/usr/local/cpanel/3rdparty/bin/php


<?php

require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
$host = "localhost";
$user = "myusername";
$accesshash = '9b15fe95a4fda0a5cb383818d709a21f
52b4852e50a75318ba693c47bf82445f
611ff80d6b929e90dea39673ccf5050c
59000e91317b464ff628acc026bd8ea1
f626bd54ca16b57hb6b2007f396460f4
0e65c4ac637118449f77dd1437c10e41
15f5a088b4dbf61e178b2ced046336c2
1b867287dfd4cfe8d8fae922d29c7984
aad8af9b63dd26186454c026ba3177a7
1d00ccd1ea8a34287e6109fc2f8ac08e
20d21ef990f69a06622d92eb1fc990a1
7dc374558884a9d0a878e06d61245a69
8a271af795782747651624d780f0b80e
e9b9ad28e52c1cdff7989d235467ccf2
3ee36dcaa9901ae76feaea5e8912764f
bbb513ea5379c1f4319f9e2ee7f36489
2bf40b9dd7ac0e452c583aa3ba4451ae
e45e075e65878d960057f262bb8ba2d4
36429c5ed3b1a80896634f5f390e83c2
9c4ba6704d3459999b2b7fa5df369ce1
acc6b839ad86aef88a66dc106a429c68
b03fabf6f187a17a44ef3143c13bdf9c
e7a81bdb8eaea663481a362144fd5f17
f4d3fa4c018ae39a2a14ea4a230bb5d7
9ad72bd89726a0c8560745957fcca1ce
056f3eff22cde4fceec58d73b6517f6a
70691c2a9d7b85fba67b29e79f89e8b7
92b92d92f7b4e5645acad7cefc462d75
6081c9aea81481b14eeceb3910219ee0';

$accts = listaccts($host,$user,$accesshash,0);
print_r($accts);
$pkgs = listpkgs($host,$user,$accesshash,0);
print_r($pkgs);
?>
That should work for you, just change the username and the access key.

I just tested this on a few servers and it works for me.
 

datocp

Registered
Jun 12, 2007
4
0
51
Just found the problem:
I've changed the localhost with the server's IP and now everything works just fine. :)
Thanks a lot for all your attempts to help!