The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Error when connecting to WHM

Discussion in 'General Discussion' started by Delatory, Apr 18, 2006.

  1. Delatory

    Delatory Registered

    Joined:
    Apr 18, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I've got this code to try and access the WHM and do stuff via a billing system which im making but when i keep trying the code it always comes up with an error of :
    PHP:
    Warningmain(): open_basedir restriction in effectFile(/wwwhsho/local/cpanel/Cpanel/Accounting.php.incis not within the allowed path(s): (/home/wwwhsho/:/usr/lib/php:/usr/local/lib/php:/tmpin /home/wwwhsho/public_html/viewaccounts.php on line 2

    Warning
    main(/wwwhsho/local/cpanel/Cpanel/Accounting.php.inc): failed to open streamOperation not permitted in /home/wwwhsho/public_html/viewaccounts.php on line 2

    Warning
    main(): open_basedir restriction in effectFile(/wwwhsho/local/cpanel/Cpanel/Accounting.php.incis not within the allowed path(s): (/home/wwwhsho/:/usr/lib/php:/usr/local/lib/php:/tmpin /home/wwwhsho/public_html/viewaccounts.php on line 2

    Warning
    main(/wwwhsho/local/cpanel/Cpanel/Accounting.php.inc): failed to open streamOperation not permitted in /home/wwwhsho/public_html/viewaccounts.php on line 2

    Fatal error
    main(): Failed opening required '/wwwhsho/local/cpanel/Cpanel/Accounting.php.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php'in /home/wwwhsho/public_html/viewaccounts.php on line 2
    This is the code im using to try and get it to work
    PHP:
    <?php
    require('/wwwhsho/local/cpanel/Cpanel/Accounting.php.inc');
    $host "localhost";
    $user "wwwhsho";
    $accesshash 'Access Hash code';

    $accts listaccts($host,$user,$accesshash,0);
    print_r($accts);
    $pkgs listpkgs($host,$user,$accesshash,0);
    print_r($pkgs);
    ?> 
     
  2. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    you have the open_basedir tweak set as on in WHM > Tweak Security, turn it off for the domain you are trying to access it from and it will work
     
  3. Delatory

    Delatory Registered

    Joined:
    Apr 18, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    And how do i do that because there is no security page in the menu. unless its in addons called Mod Security but you cant change anything
     
  4. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    In WHM under security > Tweak Security
     
Loading...

Share This Page