Powered by eUKhost®

Announcement

Collapse
No announcement yet.

Remote Access Key - Usage

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remote Access Key - Usage

    I see in WHM we have access to our Remote Access Key to enable the management of Accounts etc. in an AUTOmated way using PERL/PHP

    I don't seem to be able to include:
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';

    And get the following error:
    Warning: require(/usr/local/cpanel/Cpanel/Accounting.php.inc) [function.require]: failed to open stream: Operation not permitted in /home/*****/public_html/del.htm on line 12

    I want to be able to automate my customer experience so they can purchase hosting without my interaction...

    Any ideas?

  • #2
    Your question is quite Tricky and it wont be possible for any of our support staff to sort this problem as you have not included reference to cpanel accounting functions in your code. You need to check tutorials on cpanel.net as they provide documentation to automate account setup using scripts.
    eUKhost - eNlight Cloud Hosting || eUKhost Knowledgebase
    Toll Free : 0808 262 0255 || Skype : mark_ducadi

    Comment


    • #3
      Originally posted by Tricky View Post
      I see in WHM we have access to our Remote Access Key to enable the management of Accounts etc. in an AUTOmated way using PERL/PHP

      I don't seem to be able to include:
      require '/usr/local/cpanel/Cpanel/Accounting.php.inc';

      And get the following error:
      Warning: require(/usr/local/cpanel/Cpanel/Accounting.php.inc) [function.require]: failed to open stream: Operation not permitted in /home/*****/public_html/del.htm on line 12

      I want to be able to automate my customer experience so they can purchase hosting without my interaction...

      Any ideas?
      The reseller will only be able to do things via the API within the constraints of their reseller privileges. The XML-API (new in version 11) is a bit more robust in terms of functionality and they may consider using that instead. Documentation for that is available at: http://www.cpanel.net/plugins/xmlapi/index.html
      Thanks and Regards,
      Alex Parker
      Senior System Administrator.
      Dedicated Hosting || Semi Dedicated Hosting|Disaster Recovery Solutions

      EMAIL:alex @ eukhost.com
      MSN: alex @ eukhost.com
      SKYPE: euk_alexp

      Comment


      • #4
        PHP Code:
        <?php
        require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
        $host "localhost";
        $user "my username in here";
        $accesshash 'my hash key is in here';

        $accts listaccts($host,$user,$accesshash,0);
        print_r($accts);
        $pkgs listpkgs($host,$user,$accesshash,0);
        print_r($pkgs);
        ?>
        My code looks like the above - I want to be able to add new accounts under my reseller account, but allow someone to purchase an account online and have this created without manual intervention from me.

        Some of the functions I'll be looking to use will include : Showversion, listaccts, createacct, suspend

        I believe the issue is that we have not been granted read access to the common Accounting.php.inc file ???



        Regards
        Last edited by Tricky; 18-12-2007, 22:42.

        Comment


        • #5
          Had an online 24/7 support session with Jason.M this evening and between us (well Jason) we sorted it...

          I'd not spotted in the error : Warning: require() [function.require]: open_basedir restriction in effect. File(/usr/local/cpanel/Cpanel/Accounting.php.inc) is not within the allowed path(s): (/home/*****/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/*****/public_html/del.htm on line 12

          I'd assume I didn't have access to read the file following a previous 24/7 chat - so proceeded with the Forum Post - looking for more answers tried the 24/7 again...

          Jason.M - removed the open_basedir restriction and my scripts now work

          Another great fix and assistance just when we needed it

          Comment


          • #6
            Originally posted by Tricky View Post
            Had an online 24/7 support session with Jason.M this evening and between us (well Jason) we sorted it...

            I'd not spotted in the error : Warning: require() [function.require]: open_basedir restriction in effect. File(/usr/local/cpanel/Cpanel/Accounting.php.inc) is not within the allowed path(s): (/home/*****/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/*****/public_html/del.htm on line 12

            I'd assume I didn't have access to read the file following a previous 24/7 chat - so proceeded with the Forum Post - looking for more answers tried the 24/7 again...

            Jason.M - removed the open_basedir restriction and my scripts now work

            Another great fix and assistance just when we needed it
            Glad to hear that

            If he has helped you to sort something important then please submit a Testimonial in "Customer Testimonials" forum
            eUKhost - eNlight Cloud Hosting || eUKhost Knowledgebase
            Toll Free : 0808 262 0255 || Skype : mark_ducadi

            Comment


            • #7
              Originally posted by Tricky View Post
              Had an online 24/7 support session with Jason.M this evening and between us (well Jason) we sorted it...

              I'd not spotted in the error : Warning: require() [function.require]: open_basedir restriction in effect. File(/usr/local/cpanel/Cpanel/Accounting.php.inc) is not within the allowed path(s): (/home/*****/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/*****/public_html/del.htm on line 12

              I'd assume I didn't have access to read the file following a previous 24/7 chat - so proceeded with the Forum Post - looking for more answers tried the 24/7 again...

              Jason.M - removed the open_basedir restriction and my scripts now work

              Another great fix and assistance just when we needed it
              Yo Lucky Chap!! Most hosts don't allow this to be done for security issues since it is a common file. eUKhost is indeed great!

              Regds
              IJ

              Comment


              • #8
                Access key script only worked on other hosts

                I had a whm access key script that worked on hostgator.com host to create subdomains, and it doesn't work on eukhost for the same reason - '/usr/local/cpanel/Cpanel/Accounting.php.inc'.

                It is something to do with the security settings on the server, not the script being wrong.

                I also have a php email script that only works on a different host.

                I've set it all up now so I just redirect some pages to another host.

                I contacted eukhost about it in October but they couldn't sort it, I would however appreciate it if I could have the file unlocked as well for my website hosting.
                Last edited by guitar; 04-01-2008, 18:50.

                Comment


                • #9
                  I would suggest speaking to 24/7 support they are great

                  Point them in the direction of this post, alternatively the data is available to create a version of accounting/php/inc yourself. Which was going to be my fall back!

                  Comment


                  • #10
                    Originally posted by guitar View Post
                    I had a whm access key script that worked on hostgator.com host to create subdomains, and it doesn't work on eukhost for the same reason - '/usr/local/cpanel/Cpanel/Accounting.php.inc'.

                    It is something to do with the security settings on the server, not the script being wrong.

                    I also have a php email script that only works on a different host.

                    I've set it all up now so I just redirect some pages to another host.

                    I contacted eukhost about it in October but they couldn't sort it, I would however appreciate it if I could have the file unlocked as well for my website hosting.
                    Please provide us with some details as we would like to know the URL on which you have installed the script. We will need to remove the open_basedir restrictions for that particular domain only.
                    eUKhost - eNlight Cloud Hosting || eUKhost Knowledgebase
                    Toll Free : 0808 262 0255 || Skype : mark_ducadi

                    Comment


                    • #11
                      Hello Guitar,

                      The open_basedir restriction has been diabled for your domain. Now your should work without any errors.

                      Regards,
                      Nick J.

                      Comment


                      • #12
                        Thanks, the script works fine now

                        Thanks eukhost, the script works fine now.

                        Comment


                        • #13
                          Re: Thanks, the script works fine now

                          Quick one please. Is there a new script for this recently? Or is it the same one?
                          VPS | Dedicated

                          Comment


                          • #14
                            Re: Thanks, the script works fine now

                            Originally posted by ganddy View Post
                            Quick one please. Is there a new script for this recently? Or is it the same one?
                            Hi Ganddy,
                            This post is 7 years old. A lot has changed in 7 years. There is the API method now which works via the web port (or CURL) and many other improvements including safety measures. Consider using those instead.
                            refer to https://documentation.cpanel.net/pag...pageId=1507796 and specifically
                            https://documentation.cpanel.net/dis...o+cPanel+API+2

                            But most people use WHMCS now which has built in ability to perform cpanel account functions.

                            Best wishes,
                            Inderjeet

                            Comment

                            ban-img
                            Working...
                            X